True's beaked whale.jpg

Western spotted skunk

Hooded skunk

Yellow-throated Marten

Wolverine

Archive for the ‘General’ Category

Pyrete boats

Thursday, April 16th, 2009

I saw the MythBusters segment on making a boat out of frozen water and wood pulp, called Pyrete. It is essentially a composite material. Pyrete worked pretty good, except for it melting quickly. A boat might last in the Arctic winter for a while if the boat was made from pure water as the salt water there is a few degrees below 0°C. Even at best it would melt over the summer.

This material could be useful if the freezing point could be raised. Unfortunately, most things added to water lower the freezing point. NaCl, table salt, is the best known example. There are ways to raise the freezing point of water–certain organic acids, salts, sugar alcohols. But they require large quantities of additives, so they are either expensive or toxic or both. Too bad.

Harnessing static cling

Tuesday, April 7th, 2009

It would be useful to attach a static electricity generator on the end of a long thin rod to pick up small non-metallic things dropped behind bookcases or otherwise out of reach. Could run a band through the center of a thin rod, or easier yet just package a thin PVC rod with a piece of rabbit fur or nylon.

256 colors in vim on OS X

Saturday, April 4th, 2009

Terminal colors are broken out of the box in OS X terminals. In part due to a poor OS X terminal implementation, part due to problems with vim. I try new colorschemes and get strange, random looking results.

After many fruitless searches I finally got 256 colors working in vim in a terminal. This post and the GVim site were very helpful. It turns out that the included Terminal app in OS X only supports 16 colors. The terminal background can be set to any color which confuses the issue. The colortest Perl script available on the Gvim site makes this clear.
OS X Terminal colortest:
colortest run in Terminal

The free GNU licensed iTerm terminal does support 256 colors.
iTerm colortest:
colortest run in Terminal

OK, now the terminal supports 256 colors. There are still some hoops to jump through to get vi to show colors though. Most colorschemes are built for gui (using 24-bit RGB colors), so vim needs to be built with gui support. This can be checked with :echo has(‘gui’). It reports 1 for yes, 0 for no. The vim I had (default or Fink installed) didn’t have gui support, so I downloaded GVim and copied it over the old vim:

cp /Volumes/Vim-7.2.148/Vim.app/Contents/MacOS/Vim /usr/bin/vim

and now vim has gui support.

I copied /usr/share/vimrc to /usr/bin because the downloaded vim didn’t know to look in /usr/share and added a few configuration lines:

” Doesn’t get set right.
set t_Co=256

” Needed because the new vim doesn’t know to look in /usr/share
set runtimepath=~/.vim,/usr/share/vim/vim72_2,/usr/bin/vimfiles,/usr/bin,/usr/bin/vimfiles/after,~/.vim/after
let $VIMRUNTIME=’/usr/share/vim/vim72_2′

syntax on
colorscheme LightTan

OK, so now 256-color support works and I can set colorschemes. They still don’t look right because colorschemes made for the gui don’t look right on a 256-color terminal. There’s a great vim script called CSApprox that converts gui colors to the closest of the 256 colors and makes gui colors look pretty good in a terminal. Download it, unzip it, and copy files to the vim directory:
sudo cp plugin/CSApprox.vim /usr/share/vim/vim72_2/plugin
sudo cp autoload/csapprox.vim /usr/share/vim/vim72_2/autoload

and now when I load colorschemes they look pretty close to what the Vim colorscheme test site shows, with the only difference due to font differences.

To get full color support when I log into a linux machine I need to do some more setup. To get gui support in terminal:
yum install vim-X11
and then add to /etc/profile:
alias vi=’gvim -v’
and “source /etc/profile” to enable it.
and add:

set t_Co=256

if &t_Co == 256
colorscheme LightTan
endif

to /etc/vimrc to force 256-color mode and pick a colorscheme.

I also copied the CSApprox files to /usr/share/vim/vim70 and now it works when I ssh to this machine as well!

Indie games

Wednesday, April 1st, 2009

I ran across the independently produced game World of Goo. Fun game, the stylish graphics caught my eye.

So I wondered what was involved in creating a modern game. What’s done? Tech wise, graphics engine, physics engine, AI, etc. Art and sound. Looked around, found these two sites:

Indie Game Developer Links
Gamedev.net

Never found the a straightforward answer to my question though.

Addendum:

Reading the ‘how we made it’ articles on their site, it looks like World of Goo was made using the open source PopCap framework. PopCap includes two physics engines, the 2D Chipmonk Physics library and the 3D ODE physics library!

The eigenspace of fraud

Monday, March 30th, 2009

Interesting discussion of the basic types of fraud at Making Light: here, and a followon here.

1. Simple misrepresentation.
2. Using high-pressure tactics to confuse or intimidate the victim.
3. Shell games, sleights of hand, and switch-and-retraction cons: the pigeon drop, the Jamaican switch, Three-Card Monte, etc.
4. The Spanish Prisoner
5. Ponzi Schemes
6. Pyramid schemes
7. Selling information about, or access to, uncommon opportunities

I would add selling a dream. The con man sells people on an appealing dream and convinces them to spend time and money on it. The details determine whether this is a con, a religion, a self-deception, or an honest endeavor. For honest endeavor, consider someone who convinces a town to set up a community garden. For con, think of someone who convinces people to pool money to buy a farm and start a co-op and ends up owning the farm. For religion, think the televangelists that live in mansions built with their followers dough.

Dawkins ‘Weasel’ program as a Perl one-liner

Saturday, March 28th, 2009

Explained at Panda’s Thumb:

Over at uncommon descent William Dembski is musing over Richard Dawkins Weasel program. Why you may ask? Way back in prehistory (the 1980’s) Dawkins wrote a little BASIC program (in Apple BASIC of all things) to demonstrate the difference between random mutation and random mutation with selection, which many people were having trouble grasping. Now, this wasn’t a simulation of natural selection, and Dawkins was very careful to point this out.

But as a demonstration of selection versus simple random mutation, with the string “methinks it is a weasel” being selected in a matter of minutes, when simple random mutation would take longer than the age of the Universe, it was pretty stunning. As a result, creationists have been having conniption fits over this little program for decades. Such is its power, the Issac Newton of Information Theory, William Dembski, spent a not inconsiderable portion of his time attacking this toy program. In particular, he claimed that after every successful mutation, the successful mutation was locked into place, and couldn’t be reversed. But he was wrong, and it seems he just can’t admit it.

The Weasel program starts with a random string. Then each generation ‘offspring’ strings are generated, each with one letter randomly changed. From among the offspring, the string closest to the target string is chosen each generation. Rather quickly this process of mutation and selection will change any string into the target string. I start with “Creationism is nonsense” and my target is “methinks it is a weasle”, the target Dawkins uses.

Since the creationists are having trouble making such a program, I wondered *just how short* a program could be written to do this. Here’s a first attempt as a eight line Perl one-liner. It can be cut & pasted into a Unix terminal:

perl -e '$|=1;$s="Creationism is nonsense";$e="methinks it is a weasle";$try=11;$let=length($s);@e=split(//,$e);while($s ne $e){$i=-1;while($i++< $try){$new_s[$i]=$s;$chr=int(rand(27))||-64;substr($new_s[$i],int(rand($let)),1,chr(96+$chr));@spl=split(//,$new_s[$i]);$j=0;$new_sc[$i]=0;while($j<@e){$new_sc[$i]++if$e[$j]eq$spl[$j++]}}@sc=sort{$new_sc[$b]<=>$new_sc[$a]}(0..$#new_sc);@new=(shift@sc);while(@sc&&$new_sc[$sc[0]]==$new_sc[$new[0]]){push@new,shift@sc}$s=$new_s[$new[int(rand(@new))]];printf("Generation %5d, %-2dmismatches:  $sr",++$n,$let-$new_sc[$new[0]]);}print"n";'

(When I cut & paste the one liner on my Mac it changes the final single quote to an end quote and the last two pairs of double quotes to funny double quotes, so keep an eye out and change them back if you need to).

And the normal length 35 line program with comments:

#!/usr/bin/perl

$|=1;
$s="Creationism is nonsense";
$e="methinks it is a weasle";
$try=11; #New offspring per generation.

$let=length($s);
@e=split(//,$e);

while($s ne $e) {
  $i=-1;
  #Make $try new strings.
  while($i++< $try){
    $new_s[$i]=$s;

    #Mutate one char of the new string.
    $chr = int(rand(27)) || -64;
    substr($new_s[$i],int(rand($let)),1,chr(96+$chr));

    #Count the characters in the new string that match the target string.
    @spl=split(//,$new_s[$i]);
    $j=0;
    $new_sc[$i]=0;
    while($j<@e){$new_sc[$i]++ if $e[$j] eq $spl[$j++]}
  }

  #Find high scoring offspring strings.
  @sc = sort {$new_sc[$b]<=>$new_sc[$a]}(0..$#new_sc);

  @new=(shift @sc);
  while(@sc && $new_sc[$sc[0]] == $new_sc[$new[0]]){push @new,shift @sc}

  #Set new string to a random offspring strings from among the high scoring offspring.
  $s = $new_s[$new[int(rand(@new))]];

  printf("Generation %5d, %-2dmismatches:  $sr",++$n,$let-$new_sc[$new[0]]);
}
print"n";

Idea: clearing pre-cancerous cells

Tuesday, February 17th, 2009

Cells become cancerous through a multi-step process. The cells pick up several mutations, each clearing a natural limit on cell division and usually increasing the rate at which the cells divide. By the time a person gets old their body has many pre-cancerous clumps of cells, and cancer occurs when one of the cells in one of the clumps picks up a final mutation and becomes fully cancerous.

Cancer has proven very difficult to treat, but perhaps it is easier to treat at the pre-cancerous stage. The idea would be to treat healthy people at middle age or later and kill most of their pre-cancerous cells. This would make the pool of cells that can develop into cancer much smaller and reduce the incidence of cancer.

Chemical chemotherapy drugs would be a poor choice for this–I expect they are not effective on slowly dividing pre-cancerous cells and these drugs are also damaging.

Instead, it may be possible to trigger apoptosis (cell suicide) in pre-cancerous cells. These cells are losing their differentiation and activating abnormal signaling pathways. They are likely stressed and may already be primed to undergo apoptosis. One of the organism’s anti-cancer mechanisms is to trigger apoptosis in pre-cancerous cells. The idea here is to supercharge this mechanism.

So the idea would be to treat the person with a cocktail of drugs that induces apoptosis by activating the apoptotic signaling pathways. The treatment should be strong enough to trigger a wave of apoptosis in the most susceptible cells clearing most pre-cancerous cells from the body. There would be some normal cells killed as well but they will be replaced by normal tissue processes.

Picking traits in children

Tuesday, 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.

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

Tuesday, 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?

Report & short

Monday, 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!