True's beaked whale.jpg

Western spotted skunk

Hooded skunk

Yellow-throated Marten

Wolverine

Picking traits in children

February 17th, 2009

There’s discussion on blogs today about an LA Times editorial highlighting the news that an LA fertility clinic is offering selection of a few non-health related traits in embryos.

This technology was first developed for and used to screen out dangerous genetic disease traits. Couples who both carry the allele for a deadly genetic disease have a 1 in 4 chance of having a child with the disease (in some situations the child would have a 1 in 2 chance). IVF combined with embryo testing allows these couples to have a healthy child. A couple has embryos created through IVF and then a cell from the 8-cell stage embryo is removed and tested for a trait. Apparently some fertility clinics now offer gender selection and will offer selection based on “eye color, hair color and complexion”.

This technology has inherent limits–embryos are being selected from a pool of 6-10 that are created by a round of IVF. So only simple, single gene traits can be picked. If you want a boy the pool is cut in half and now the parents are picking from 3-5 embryos. If both parents have the simplest eye color situation and both carry an allele for blue eyes, 1 in 4 embryos will have it. Parents get at most two choices of simple single gene traits and few traits are determined by a single gene.

Very little is known today about normal human genetics, that is what genes to test for, but that will change and is not an inherent limit to this technology. The curious fact that we know almost nothing about the genetics of normal human traits is a story for another day.

In a few years when we have a better understanding of medical genetics parents will be able to pick the embryos with the fewest and least severe set of disease gene alleles (and even then each embryo will have many bad traits). This choice will for almost all parents trump select of any other trait. Who would pick a green-eyed baby with a 90% lifetime risk of heart disease over a one with a 10% heart disease risk and brown eyes? So concern about IVF clinics offering this is wasted breath, it is a passing notion that will last a few years at most.

This technology has no prospect of offering more detailed choices for parents. More choices would require selecting among more embryos (or among more sperm and eggs), and nothing like that is on the horizon, i.e. it won’t happen in the next thirty years.

Rare as a total eclipse–a useful Slashdot article

February 9th, 2009

Today Slashdot had an ‘Ask Slashdot’ post asking the question “Mathematics Reading List For High School Students?” Slashdot reader comments usually start are typically dismal and often worse. The only useful comments I’ve seen come to questions both technical and obscure. Looking for a Scheme compiler for the Commodore 64 or tools for hacking a router and Slashdot commenters can help.

But today a rare gem, an interesting question of general interest on /. worth reading. Here’s a summary of the suggestions:

(the obvious: Flatland, GEB)

How to Lie with Statistics by Darrell Huff, 1954
Men of Mathematics by E. T. Bell
How to Think Like a Mathematician: A Companion to Undergraduate Mathematics by Kevin Houston
All the Mathematics You Missed But Need to Know for Graduate School by Thomas A. Garrity
Prisoner’s Dilemma by William Poundstone
Schaum’s Outline of Linear Algebra by Seymour Lipschutz
The Feynmann Lectures on Physics by Richard Feynman, Robert Leighton, and Matthew Sands
Surely You’re Joking, Mr. Feynman by Richard Feynman
Bringing Down the House: The Inside Story of Six M.I.T. Students Who Took Vegas for Millions by Ben Mezrich
The Golden Ratio: The Story of PHI, the World’s Most Astonishing Number by Mario Livio
Fermat’s Last Theorem by Simon Singh
The Code Book: The Science of Secrecy from Ancient Egypt to Quantum Cryptography by Simon Singh
The Codebreakers: The Comprehensive Story of Secret Communication from Ancient Times to the Internet by David Kahn
Against the Gods: The Remarkable Story of Risk by Peter Bernstein
Knots : Mathematics with a Twist by A. B. Sossinsky
The Little Schemer by Daniel P. Friedman and Matthias Felleisen
The Pleasures of Counting by Thomas William Körner
Innumeracy and A Mathematician reads the Newspaper by John Allen Paulos
The Shape of Space by Jeff Weeks
‘e’: The Story of A Number by Eli Maor
What is mathematics? by Courant and Robbins
A Pathway Into Number Theory by R. P. Burn
Zero: The Biography of a Dangerous Idea by Charles Seife
A Long Way From Euclid by Constance Reid

and to add a few not mentioned:
Chaos by James Gleick
Five Equations That Changed the World: The Power and Poetry of Mathematics by Michael Guillen
Mathematical People: Profiles and Interviews by Donald J. Albers and Gerald L. Alexanderson

And last and best, any of the books of Martin Gardner’s Recreational Mathematics columns from Scientific American.

Spelunking partition tables with testdisk

February 6th, 2009

I have my home directories on a separate drive from the OS, and after upgrading Fedora I went to remount my home directory and ran into problems. First off, the new Fedora had renamed hda as sda and so all the drive naming was off. I had my home directory disk mirrored in RAID 1, but some months ago one the the drives went bad and I dropped it from the array but left it plugged in until I had time to deal with it.

So I looked around for my home directory disk and mounted the one that had gone bad. It was working fine when I mounted it, so I didn’t notice until a few days later when it I noticed recently created files were missing and eventually figured it out.

So I could find the ‘good’ home directory disk and mount it, right? Not so easy, it turned out to have a small ext2 partition and a large LVM partition. Which is not the way it should be, it should have one partition. I mount the small one, and it throws ‘read past end of disk’ errors. It takes quite a while to figure out how to mount and read the LVM partitions. LVM is a really, really idea. The LVM tools couldn’t find a filesystem on the LVM partition, and after much hair pulling I realized that there really *wasn’t* one, that the partition shouldn’t exist. Because it was LVM, this took about 10X longer than it should have.

Now running with the hypothesis that the home directory disk had picked up a disk error in the partition table (Argg^&@$#@!), I made a backup image of the drive using dd:

dd if=/dev/hdc of=/data/hdc_copy.bin

Then I mounted the image as a loopback device:

losetup /dev/loop0 /data/hdc_copy.bin

And started working with the image to repair it. Looking around, testdisk seemed promising, so I installed it, ran it. Testdisk finds potential partitions on the disk, and lets you view the files in them to see if it has guessed right. After a few tries I found a testdisk partition that contained my home directories. At this point I used testdisk’s copy function to save the most critical recently (no backup) changed directories. This worked and I was hopeful. Then I had testdisk write the partition it had found to the disk image.

Now running fdisk on /dev/loop0 shows the single partition (/dev/loop0p1) spanning the whole disk as expected. /dev/loop0 can’t be mounted by itself as it is an image of the disk, not a file system (/dev/loop0p1 isn’t a device in /dev, just a fdisk label). So I had to mount the partition as a second loopback device using the info from fdisk to find the correct offset:


Disk /dev/loop0: 203.9 GB, 203928109056 bytes
1 heads, 1 sectors/track, 398297088 cylinders, total 398297088 sectors
Units = cylinders of 1 * 512 = 512 bytes
Disk identifier: 0x00000000

Device Boot Start End Blocks Id System
/dev/loop0p1 64 398283327 199141632 83 Linux

So I tried an offset of 64 * 512 = 32768:

losetup -o 32768 /dev/loop1 /dev/loop0

and then ran e2fsck on /dev/loop0. But e2fsck wasn’t happy, and none of the alternate superblocks worked either. Finally I found a reference to doing this that mentioned setting fdisk to sectors first:


Command (m for help): u
Changing display/entry units to sectors

Command (m for help): p

Disk /dev/loop0: 203.9 GB, 203928109056 bytes
1 heads, 1 sectors/track, 398297088 cylinders, total 398297088 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x00000000

Device Boot Start End Blocks Id System
/dev/loop0p1 63 398283326 199141632 83 Linux

Ah ha, the sector offset is *really* 63, so 63 * 512 = 32256 bytes, and after

losetup -o 32256 /dev/loop1 /dev/loop0

e2fsck now sees the file system and works! BTW sending e2fsck the SIGUSR1 signal makes it show a progress bar:

kill -s SIGUSR1 <e2fsck pid>

and after e2fsck completes I can mount the now good file system:

mount /dev/loop1 /mnt/home_recover
and it works!

With a good copy of the home directory filesystem I now was willing to risk changing the original drive, and ran testdisk and e2fsck on it following the same course. I was able to fix the partition table, clean the filesystem, and mount it! My home directories are all back!

Discussion of 13 Things That Don’t Make Sense, by Michael Brooks

January 26th, 2009

I read a review of Michael Brooks’s 13 Things That Don’t Make Sense on the Uncertain Principles blog. I haven’t read the book, but the review tickled me enough that I looked around for more info and found Jennifer Ouellette’s review in The New Scientist where Brooks is a contributor.

Both Chad Orzel and Jennifer Ouellette give Brooks weak “this book has some weak parts but also some good parts” reviews. Just from the reviews and blurbs I can tell Brooks book is destructive, part worthless speculation on the meaning of anomalous results that are almost certainly erroneous and part flattering discussion of pseudoscience.

Why are people giving Brooks such gentle reviews? The physics results are typical of the lot. John Webb’s fine-structure result is of the same sort as the Viking experiment result. Interesting if true, but not reproduced and instead contradicted by other experiments and thus uninteresting.

Brooks doesn’t understand that for something to not ‘Make Sense’ it has to be true. Anomalous *verified* results, results that can’t be explained theoretically or seem to contradict existing results are the kinds of things that ‘Don’t Make Sense’ but could be cool. These are the kinds of things that Brooks should be writing about.

One of Brooks’s topics is the mimivirus, a virus with the largest genome known so far (1.2 Mb). I can’t imagine anything particularly Earth shaking about it–it’s really big for a virus, but that’s it. Biology is littered with oddities and weird exceptions. No one tell Brooks about ttn-1, a titin protein 57X larger than the average worm protein. Or about the ostrich.

The placebo effect has two components, self-delusion and a poorly understood mechanism whereby the state of mind can affect the body. The mind->body connection is true and poorly understood, the proper subject of Brook’s book.

In Jennifer Ouellette’s review she says that Brooks includes homeopathy because of its relation to the placebo effect. This is ridiculous–any of the thousands of worthless ‘medical’ treatments known from blood letting to magic spells have this property.

Brooks’s inclusion of homeopathy and death is complete nonsense. Homeopathy is pseudoscience, bunkum. And there well understood evolutionary reasons why organisms die, death (and aging) are not even anomalous.

President’s Council on Bioethics: dying of old age is good

January 20th, 2009

The President’s Council on Bioethics under President Bush put out a remarkable report, Beyond Therapy: Biotechnology and the Pursuit of Happiness. It’s worth noting this report before the Bush administration passes into history. Bush’s Bioethics chairman, Leon Kass, will no doubt continue pushing his ideas in other forums for years.

The report was written be the Council chaired by Leon Kass, a professional ‘bioethicist’, and the report makes quite odd assertions. It starts by explaining its motive; people would like to stay young longer and aging science has the potential to offer this in the next few decades:

Still, when properly examined, something like a desire for an “ageless body” seems in fact to be commonplace and deeply held; and should our capacities to retard the senescence of our bodies increase, that desire may well become more explicit and strong.

But Leon Kass sees this as a bioethical issue, and not a positive one, but instead thinks that living longer would be a bad thing. He wants to jump on the issue now to keep people from getting excited about the prospect. Yeah, it will be a hard sell.

The moral case for living longer is very strong, and the desire to live longer speaks powerfully to each and every one of us. But the full consequences of doing so may not be quite so obvious.

The report goes on to survey the ravages of aging and the prospects for reversing them and preventing this horrible toll of suffering and death. Then it begins making the moral case for the ravages of aging!

Being “used up” by our activities reinforces our sense of fully living in the world. Our dedication to our activities, our engagement with life’s callings, and our continuing interest in our projects all rely to some degree upon a sense that we are giving of ourselves, in a process destined to result in our complete expenditure. A life lived devoid of that sense, or so thoroughly removed from it as to be in practice devoid of it, might well be a life of lesser engagements and weakened commitments-a life other than the one that we have come to understand as fully human. This is not to say it will be worse-but it will very likely be quite different.

A far more distant horizon, a sense of essentially limitless time, might leave us less inclined to act with urgency. Why not leave for tomorrow what you might do today, if there are endless tomorrows before you?

But people in search of other more direct and immediate answers, or, more to the point, people whose longer lease on life leaves them relatively heedless of its finitude, might very well be far less welcoming of children, and far less interested in making the sacrifices needed to promote human renewal through the coming of new generations.

Would people in a world affected by age-retardation be more or less inclined to swear lifelong fidelity “until death do us part,” if their life expectancy at the time of marriage were eighty or a hundred more years, rather than, as today, fifty? And would intergenerational family ties be stronger or weaker if there were five or more generations alive at any one time?

The last question is easy to answer–people would have stronger ties to their family if they were able to meet more generations. Also, the quality of the relationships would be better–today people meet their grandparents and great-grandparents only as the elderly shadow of themselves, people who have lost the physical ability to pursue their interests and avocations, and people disengaging with family and the world.

The fact that we might die at any time could sting more if we were less attuned to the fact that we must die at some (more-or-less known) time. In an era of age-retardation, we might in practice therefore live under an even more powerful preoccupation with death, but one that leads us not to commitment, engagement, urgency, and renewal, but rather to anxiety, self-absorption, and preoccupation with any bodily mishap or every new anti-senescence measure.

But what if, in the “stretched rubber band” sort of life cycle, the period of debility became even more protracted and difficult than it now is? … And in the absence of fatal illnesses to end the misery, pressures for euthanasia and assisted suicide might mount.

But in considering the offer, we must take into account the value inherent in the human life cycle, in the process of aging, and in the knowledge we have of our mortality as we experience it. We should recognize that age-retardation may irreparably distort these and leave us living lives that, whatever else they might become, are in fundamental ways different from-and perhaps less serious or rich than-what we have to this point understood to be truly human.

The neediness of the very young and the very old puts roughly one generation at a time at the helm, and charges it with caring for those who are coming and those who are going. They are given the power to command the institutions of society, but with it the responsibility for the health and continuity of those institutions.

A society reshaped by age-retardation could certainly benefit from the wisdom and experience of more generations of older people, and from the peace, patience, and crucial encouragement that is often a wonderful gift of those who are no longer forging their identity or caught up in economic or social competition. But at the same time, generation after generation would reach and remain in their prime for many decades.xvii Sons might no longer surpass their fathers in vigor just as they prepared to become fathers themselves. The mature generation would have no obvious reason to make way for the next as the years passed, if its peak became a plateau. The succession of generations could be obstructed by a glut of the able. The old might think less of preparing their replacements, and the young could see before them only layers of their elders blocking the path, and no great reason to hurry in building families or careers-remaining functionally immature “young adults” for decades, neither willing nor able to step into the shoes of their mothers and fathers.

Disappointed hopes and broken dreams, accumulated mistakes and misfortunes, and the struggle to meet the economic and emotional demands of daily life can take their toll in diminished ambition, insensitivity, fatigue, and cynicism-not in everyone, to be sure, but in many people growing older.

Yes, the poor would hardly be happy to be poor forever, and the forces that damp the determination of the poor to change society–the ignorance and optimism of youth, the decline of the old–would be lessened. Ha. I think Leon Kass is lacking imagination here.

A society is greatly strengthened by the constant task of introducing itself to new generations of members, and might perhaps be weakened by the relative attenuation of that mission. A world that truly belonged to the living-who expected to exercise their ownership into an ever-expanding future-would be a very different, and perhaps a much diminished, world, focused too narrowly on maintaining life and not sufficiently broadly on building a good life.

And this concluding section is quite widdershins. The natural conclusions seem to be the opposite of the ones Kass seeks to draw:

A society reshaped in these and related ways would be a very different place to live than any we have known before. It could offer exciting new possibilities for personal fulfillment, and for the edifying accumulation of individual and societal experience and wisdom. But it might also be less accommodating of full human lives, less welcoming of new and uninitiated members, and less focused on the purposes that reach beyond survival

Conversely, in affirming the unfolding of birth and growth, aging and death, might we not find access to something permanent, something beyond this “drama of time,” something that at once transcends and gives purpose to the processes of the earth, lifting us to a dignity beyond all disorder, decay, and death?

Scanning and posting photos

January 20th, 2009

I scanned in a bunch of family photos, fixed them up, added captions, and posted them on Google’s Picasa Web Album.

I used a flatbed scanner and filled it with photos each scan. This necessitated splitting and cropping each scan into separate images. To speed this along I wrote an AppleScript to call Photoshop’s “Crop and Straighten Photos” function and then save the images.

split_img Applescript

The script worked pretty well for about half the images. I went through and cropped/straightened each image. Then I automatically ran Auto Levels and Auto Contrast or Auto Colors on each image using a second Applescript.

adjust_img Applescript

I wanted to add captions and tags to each image using a list of captions I made when I scanned the photos. Jpg images can store this meta data in the file using the IPTC standard. Unfortunately, Google’s Picasa uploading applications terribly buggy and don’t work well with IPTC tags added by other programs like iPhoto or EXIFutils. So I couldn’t use Google’s Picasa software or plugins to upload the photos.

Google makes an API for interacting with their web sites available, and there is a Perl module, Net::Google::PicasaWeb, available that allows adding captions and tags when uploading pictures. Testing showed that it worked so I wrote a small Perl program to take a tab-delimited text file of images, the target album, the caption, and any tags and load the photos onto the Picasa Web Album site. I needed to use the most up to date version of Net::Google::PicasaWeb and make a one line change.

picasa_upload Perl program

My Picasa Web Album:

Old family photos (Jan. 2009)

Doug Green talk on apoptosis

January 13th, 2009

“106 cells die every second in your body.”

At a rough estimated weight of 10-9 g/cell this works out to 10-3 g per second, 100g per day of cells die.

Better than LOLcats?

December 23rd, 2008

This is what the internet is for, I love this site. It’s been up for a few years and they never run out of pictures.

Workers over aligator pit

Report & short

December 22nd, 2008

The fracture of the US financial system gives me an idea for a new business model.

1) Raise some capital.

2) Use a tiny fraction to hire a few business/finance reporters, and have them find a company riddled with fraudulent business practices. How hard can it be–this stuff is common and not very well hidden. Look at Enron, Halliburton, the Madoff Ponzi scheme.

3) Then short the company’s stock, send the evidence to the appropriate regulatory and oversight agencies, feed the info to the press, and profit!

Bigfoot and cheap cameras

December 22nd, 2008

You would think someone would have caught a photo of bigfoot by now considering how much more common cameras have become in the past decade. Point-and-click cameras and cell phone cameras are in everyone’s pocket. Instead, ‘peak Bigfoot’ was in the 50’s and 60’s, when cheap movie cameras became available to the hoaxing public…