Lisp – wow, that’s a weird feeling.

October 25, 2008

I’ve been holed up in my office lately, teaching myself Common Lisp for an upcoming part of my Ph.D, and I have to tell ya, it’s a weird feeling to write code in Lisp.  I read through Peter Seibel’s great online book Practical Common Lisp, which is an absolutely brilliant resource for first time Lispers, especially those coming from other languages.  (I will admit to a bit of irony, though:  I downloaded the book and wrote a Python script to HTMLize the footnotes into links so that I could jump back and forth without having to continually figure out where the hell I had been when I went to read that note).

In any case, I just finished my first “real” program in Lisp – real in that it was done entirely on my own and required more than 5 lines of code, though the problem I “solved” was an imaginary one.  It’s one of those throwaway efforts to acquaint yourself with a new way of thinking.  I went into it thinking that Lisp was overblown, one of those things that people looked back on fondly with rose-colored glasses while muttering about how “real programmers used to do it”, but by the time I was finished writing the thing, I found that I was actually enjoying myself.  I can’t even explain why, but by the end of writing the program, I was actively looking for new ways to extend the idea so that I could keep writing code!  And now, I find myself looking forward to my next program in Lisp, a far cry from where I started.

(If you’re wondering what I was writing, it’s kind of embarassing, but here it is:  I wrote a program to quantify the cost to typing words on a keyboard from the perspective of a single-finger, one-handed typist.  The “cost” is distance – i.e. how far would the finger have to travel – defined by adjacent keys, so that ‘T’ and ‘E’ are two units apart (‘T’ -> ‘R’ -> ‘E’).  I did this using cl-graph to map the keys onto a graph, and wrote an implementation of Djikstra’s algorithm to calculate the distances between key pairs.  I could then calculate the distance between each pair of letters in a word and sum the distances to get the total cost, which I then averaged over the length of the word so that the penalty for long words was minimized.  After that, it was a snap to write a couple of functions to do things like take in a word list and write out each word with its associated cost, or to get the total cost of a string.  See?  Told you it was trivial. :-) )


Scientific salaries.

October 22, 2008

And this is why you don’t go into academia for the money.


10% of our brains, eh?

October 21, 2008

I love Greg Dean’s webcomic, Real Life.  It has some moments of true hilarity in it, and I find the characters enjoyable enough that I’m thrilled to see each new comic pop up in my RSS feeds.  But today’s comic contains a howler which I just can’t let pass. If you don’t want to go read it, the fun is in the final panel where one of the characters says “Hey, it’s not like you were using the other 90% of your brain anyway.”

Now, if you’re literate about neuroscience in any way, this will immediately strike you as stupid;  the myth about human beings using only 10% of their brains is wrong, and that’s been known for decades.  But to be honest, I could have let this go and just read the comic, until I came across a posting in the Real Life Forums by Greg himself, as part of an exchange with another person who commented on this problem:

[BEGIN QUOTE]

Kovac wrote:gaghWhy would you contribute to the myth that humans only use 10% of our brains?

It is for the purpose of a joke, but it just isnt worth it x

Allow me to quote Scientific American, so you foreigners can quit being such dicks about it. (Seriously, I’ve recieved another e-mail from someone else today telling us Americans to quit being so ignorant. Is this just a pet peeve of everyone on the other side of an ocean from us, or something?)Anyway, as I was saying:

Scientific American wrote:Another mystery hidden within our crinkled cortices is that out of all the brain’s cells, only 10 percent are neurons; the other 90 percent are glial cells, which encapsulate and support neurons, but whose function remains largely unknown. Ultimately, it’s not that we use 10 percent of our brains, merely that we only understand about 10 percent of how it functions.

NOW. While I will grant you that the concept that “we only use 10% of our brains” is silly, it’s also been used for DECADES as the basis for a lot of fun “what-if” style storytelling. Powder and Phenomenon are two excellent movies that come to mind which deal specifically with this idea. So, I think what I’m saying is, quit being such a fucktard about something so INSIGNIFICANTLY POINTLESS as this, and just try to enjoy the fucking comic.  I’m sorry if I’m getting a little on the offensive here, but this pedantic bullshit just pisses me off. Especially when it’s passed off in the guise of “Gee, you Americans sure are stupid.” (I know you didn’t do that specifically, but that was the tone of the other e-mail I recieved, and it stuck in my craw a little.)

[END QUOTE]

Uh, wow.

Here’s a couple of points in response, Greg:

  • Really – you’re going to base your argument on the past usage of science in media?  Seen a lot of 50-foot tall women in the talkies lately?  How about books about a guy who goes to the moon by being shot out of a cannon?  Even Marvel is smart enough to keep up with advances in our knowledge, if you’ve seen the re-write of the Spider-man origin in the Ultimates universe (from a radioactive spider to a genetically altered one).
  • To people who don’t know any better, you’re propagating the idea that there is some locked-away 90% of our brain that would turn us into magical super-heroes if we could only access it.  This is a lie, Greg, and it is part of a real issue;  scientific literacy in the United States, where you’re from, is shockingly low. This makes you part of the problem.

Scientists like me struggle every day to correct the misconceptions of science in the public’s view, so you’ll have to forgive us if hearing that we should just shut our yap – because you’re too lazy to come up with a plot point that doesn’t depend upon a thoroughly discredited idea from well over a century ago – is a problem for us.  And if it’s such an insignificant point (as you say to us ‘fucktards’), why can’t you just get it right?

Oh, and Greg, as for your quoting of the Scientific American article:  way to cherry-pick.  The “ultimately we only understand 10% of how it functions” bit is a rhetorical closing at the end of the article.  I prefer this quote from the middle of the piece:

Adding to that mystery is the contention that humans “only” employ 10 percent of their brain. If only regular folk could tap that other 90 percent, they too could become savants who remember π to the twenty-thousandth decimal place or perhaps even have telekinetic powers.

Though an alluring idea, the “10 percent myth” is so wrong it is almost laughable, says neurologist Barry Gordon at Johns Hopkins School of Medicine in Baltimore. Although there’s no definitive culprit to pin the blame on for starting this legend, the notion has been linked to the American psychologist and author William James, who argued in The Energies of Men that “We are making use of only a small part of our possible mental and physical resources.” It’s also been associated with to Albert Einstein, who supposedly used it to explain his cosmic towering intellect.

Emphasis mine.  Or how about this one, from the same article?

Although it’s true that at any given moment all of the brain’s regions are not concurrently firing, brain researchers using imaging technology have shown that, like the body’s muscles, most are continually active over a 24-hour period. “Evidence would show over a day you use 100 percent of the brain,” says John Henley, a neurologist at the Mayo Clinic in Rochester, Minn. Even in sleep, areas such as the frontal cortex, which controls things like higher level thinking and self-awareness, or the somatosensory areas, which help people sense their surroundings, are active, Henley explains.

p.s. Greg, I’m Canadian, not American, so consider my pedantry  to be a message from your own side of the ocean.


Seminar Flow Chart

October 8, 2008

If I were inclined to say it in that special Intertubes way, I’d say:  OMG!!@!  Thiz is sooooo me!!1!1!


“Total Biology” comes to Canada…

October 8, 2008

The CBC is reporting on the spread of “total biology” to Canada;  this story is the first that I’ve heard of this tripe:

A new therapy that claims to cure cancer and other diseases but has been blamed for dozens of deaths in Europe is gaining popularity in Canada, according to a Radio-Canada investigation.

“Total biology” is a therapeutic approach that claims illness is caused by psychological conflicts in the brain.

The approach, also known as new medicine or bio-psycho-genealogy, professes to heal all disease, including AIDS and advanced forms of cancer.

The method is gaining traction in Quebec where patients are often told to ignore their cancer, or stop medical treatment altogether, according to an investigation by CBC’s French-language service.

Some European practitioners have been convicted for illegally practising medicine and another is being sued — but in Quebec, total biology’s proponents are active in more than 30 Quebec cities.

The founder of total biology, Dr. Claude Sabbah, claims that up to 90 per cent of all illnesses are caused by messages from the medical community.

He teaches his approach in six-day seminars offered in France and Canada. He tells students that cancer and other diseases are formed in the brain first, and must be deprogrammed.

During the investigation, Radio-Canada journalists went undercover with hidden cameras seeking medical advice about fictitious diseases.

One of the journalists claimed to have breast cancer. She visited several total biology practitioners who told her that her life was not in danger, and the lump in her breast was the result of a maternal conflict.

She was recommended to stop chemotherapy altogether. During another visit a practitioner told her to drink champagne and relax.

Wow.  It seems that people will believe just about anything.  I want to be angry at the people who are buying into this woo, but I really can’t;  I can only feel sorrow for them.  The drive to understand tragedy and gain control over an illness in your life is strong, and I understand how these sorts of snake-oil peddlers use that to their advantage, but it makes it even more important that we educate people on the basics of medicine and science so that they can protect themselves.


Where are the NDP on science?

October 5, 2008

I’ve been paying attention to Canadian politics as I look forward to exercising my democratic rights ina couple of weeks.  I’ve never been seriously interested in the NDP, for the simple reason that they never seemed to be in a position to take power, but with the Liberals melting down in the polls recently, I’ve come to view the NDP as a serious contender for (at least) the opposition.  Since I would normally vote Liberal, this now leaves me pondering my choices more carefully.

To help figure out what I’m going to do, I sat down tonight to review the platforms of both the Liberals and the NDP.  Mr. Layton’s was interesting, with many ideas on important issues like climate change, the economy, and so on.  But if you’ve read this blog for any time at all, you’ll know that I’m a Ph.D student in Biology, and that science is very important to me.  So what is the NDP stance on science and scientific research in Canada, you ask?

Beats me.

The NDP platform is weirdly vague to begin with.  But doing a search through the document reveals a single mention of the word “science”, and that’s in regards to climate-change.  Searching for “research” leads to such vague platitudes as:

[we will…]  Encourage the best young minds to stay here in Canada by increasing funding for university and college-based research, and for graduate and post-graduate studies.

and

[we will…] Introduce measures to ensure that new drugs are evaluated through evidence-based research to be more effective, before they are prescribed by doctors and paid for by Canadians.

and

[we will…] Work with the provinces and territories to encourage research and develop strategies to minimize the effects of climate change on communities, vegetation and wildlife.

and

Stop the hollowing out of Canadian industries by strengthening the Investment Canada Act. Foreign takeovers of Canadian companies will be subject to more stringent tests respecting job protection and creation, head office location, and the promotion of research and development in Canada.

That’s literally every mention of the word “research” in the NDP platform (and every single mention of “university” as well, come right down to it), yielding not a single concrete item on the matter.  Contrast that with this section of the Liberal platform:

A Liberal government will increase support for the indirect costs of university-based research to $500 million a year, which at full implementation will represent a more than 50 percent increase over current levels.

For researchers and graduate students, a Liberal government will increase the budgets of the three granting councils by 34 percent over four years.  Support for the Canadian Institutes of Health Research (CIHR) and the Natural Sciences and Engineering Research Council (NSERC) will both increase to $1.275 billion a year from the current levels of $960 million.  Funding for the Social Sciences and Humanities Council (SSHRC) will be increased to $450 million a year from the current level of $320 million.

We will also create an Interdisciplinary Sustainability Fund of $100 million.  This Fund will be available to scientists, researchers and graduate students for projects that reach beyond the barriers of their discipline.  Interdisciplinary research is the way of the future.   It is how we will address complex scientific challenges – like adaptation to the climate change crisis – that affect our economy and our society. government will increase the budgets of the three granting councils by 34 percent.

You see, now there’s a set of hard targets that I can vote on.  Seeing as I’m funded (well, I *hope to be* funded) by NSERC, knowing that the Liberals would increase their budget is useful information.  Since NSERC and its sister agencies fund much of the public scientific research in Canada, this is a sign that the Liberals would take basic and applied science seriously.

But the NDP?  I have no idea what they would do.  They’re going to “encourage the best minds”?  How?  I might be interested in voting NDP, but I just really need to know more than this big steaming pile of nothing that I’ve got before me right now.  Jack Layon, or one of your supporters, if you’re reading this:  help a guy out.  Help me vote for you.  Explain what the hell you’re talking about.


New parallel programming tool in Python 2.6

October 3, 2008

For some reason or another, I’m getting a lot of long-term hits to this post that I wrote a few months ago on parallel programming with Python.  Thus, I thought I might share the news with people who have been looking for solutions to this problem:  Python 2.6, which was just released, contains a new multiprocessing library which at first glance seems to formalize the procedure I outlined in my previous post and make it more robust.  From the description:

multiprocessing is a package that supports spawning processes using an API similar to the threading module. The multiprocessing package offers both local and remote concurrency, effectively side-stepping the Global Interpreter Lock by using subprocesses instead of threads. Due to this, the multiprocessing module allows the programmer to fully leverage multiple processors on a given machine. It runs on both Unix and Windows.

If you’re interested in that, go grab 2.6 and check out the documentation for the package here!


Follow

Get every new post delivered to your Inbox.