March 2008 Archives

What is 2+2 in Wood?

| 1 TrackBack

Check out this creation, the Bene Gesserit would be happy.

The Age of The Machine

| 1 Comment

Make it viral.

Bees, Bees, Bees


A couple weeks ago, tree surgeons working out side of a hospital in Wake county, discovered that there was a large hive of bees living in large oak that needed to come down. Due to the decline of wild and domestic honey bees, the state and county governments sent beekeepers to save the hive. The story was popular in the local news and made the NY Times as well.

Volunteers with the Wake County Beekeepers Association and state bee specialists squirted smoke from smoldering canisters into the opening of the giant oak to calm the bees, then moved eight large chunks of honeycomb from the trunk to a new bee box.

“We got them a good home,” said Danny Jaynes, president of the Wake County Beekeepers Association and hobby beekeeper. “It’s one of the most rewarding days of my beekeeping life.”

The combs, containing thousands of adult bees, juveniles and eggs, were placed inside wooden frames. The frames hang vertically like files inside the bee box. By moving the combs, beekeepers expect most of the bees will relocate to raise the young bees and make a new home.

Pen Ultimate Thursday

The FBI is trying a new tactic to capture pedophiles. They are posting links to illegal media on internet message boards, and then arresting anyone who visits those websites; cnet has the story.

As expected, the FBI’s new tactics follow the Bush administration’s policy of being incompetent and attacking our freedoms at the same time. How so?

First let me describe the trap. An agent went to a message board where suspected trafficking in illegal media was occurring. The agent then made a disgusting post describing a video and then posted links to said video on the board. These links then went to some files on the FBI’s machines, which contained random noise. However, the FBI recorded everyone who visited their machines and got search and/or arrest warrants for any visitors from the US.

Sounds like great police work, right? Wrong.

The FBI neglected to record important information in their servers that is necessary to prove intent to download illegal media: how visitors got to their site. Without this information the FBI is unable to prove that a suspect visited their honeypot via the agent’s disgusting board post. Instead someone could have received an email that read “hey look at this FBI honeypot” and then followed the link from there. (I understand that would be rather odd at this juncture, but it’ll happen if this program expands.)

An insidious possibility is that a malicious user, who knows about the honeypot links, could create redirect links to the honeypot and bait people to click them, via say a tiny url posted in the comments of a blog. When the person clicked such a link, there would be no way for them to tell that the link went to the FBI’s fake illegal media.

A more insidious possibility is that someone could use various web technologies, like image, script, or css tags to make someone’s browser access the link without them clicking on it, and they’d have no idea that their computer visited the FBI’s honey pot until the 7am raid.

This doesn’t even begin to address the problem of connecting an IP to an individual. One simply can’t prove, without good evidence, that the person who owns the internet account was the one using it at the time the download occurred. Not only could someone else have access to their computer, but if they have a wireless network, someone could have hacked into their home network and piggybacked their network.

However, the FBI, juries, and courts don’t care or appreciate all these issues. Instead, they believe that anyone and everyone who accessed their website was there to download illegal media and that the person whose name is on the internet bill was the one who did it. This is unsound logic, and contains inherent reasonable doubt about the guilt of the accused. There are major implications for our freedoms if the government can send people links to “illegal” material and then throw anyone in jail whose IP address accessed those site. Spam would then become Big Brother’s biggest asset.

Having said all that, I will point out that this FBI tactic can be effective if used sparingly and smartly. (I know—I know.) For starters, the FBI needs to keep detailed records of the activity on their honey pots, including from where they were accessed. That way they will have evidence that someone clicked the link as the FBI intended: from an illegal media site. Furthermore, the FBI needs to use their honeypots as probable cause to get search warrants and wiretaps, which can reveal hard evidence of trafficking in illegal media. That way they don’t have to prosecute people for crimes that can’t be proven beyond a reasonable doubt. I hope that they are already working towards this. Perhaps the only reason the person in the article above was charged with an attempt to download illegal material is that the FBI didn’t find anything against him at his house. Maybe, but it is doubtful.

A traditional library for command line processing is the getopt library. For C++ programmers, a powerful alternative is the Boost::Program_options library (PO). PO allows you to specify your options in a rather simple and flexible way:

po::options_description desc("Allowed options");
    ("help", "produce help message")
    ("compression", po::value<int>(), "set compression level")

What I like about OI is that it does all the heavy lifting for you, like putting the command-line options into variables:

    ("ouput-file,o", po::value<std::string>(&arg_output_file)->default_value("out.txt"), "Save output to file.")

Now you can access your program and pass command line options to it:

foo --output-file=foo.out
foo -o foo.out

And after the application processes your command line options, the values of output-file will be found in the arg_output_file variable. Now you just have to create a bunch of arg_ variables, and then pass them to add_options. However, this quickly becomes hard to maintain when you realize that to add a new command line options, you may have to edit multiple files to get it to work right. This is where the awesome power of X-Macros come into play.

X-Macros are undefined macros that are contained in a file, say app.cmds:

//XCMD(lname, sname, desc, type, def) 
XCMD(help,             h, "display help message", bool, false)
XCMD(version,          v, "display version information", bool, false)

One uses these X-Macros by defining XCMD in a source file, including app.cmds, and then undefining XCMD. By defining XCMD different ways, you can reuse your cmds file.

#define XCMD(lname, sname, desc, type, def) type arg_##lname ;
#include "app.cmds"
#undef XCMD

po::options_description desc("Allowed options");
#define XCMD(lname, sname, desc, type, def) ( \
    #lname "," #sname, \
    po::value< type >(&arg_##lname)->default_value(def), \ 
    desc )
#include "app.cmds"
#undef XCMD

This code would become the following after preprocessing the X-Macros.

bool arg_help;
bool arg_version;

po::options_description desc("Allowed options");
    ("version,v", po::value< bool >(&arg_version)->default_value(false) , "display help message")
    ("help,h", po::value< bool >(&arg_help)->default_value(false) , "display version information")

Now to update your command line options, all you need to do is edit your commands line file, and PO and X-Macros will do the rest for you. Isn’t that totally cool!

I’ve uploaded a simple application framework that makes use of these concepts. I’ve used it in my recent application development, including the 1.2 version of Ngila, and three other unreleased projects. Click here to download the framework. You will of course need to install Boost to use it.

The X-Macros in this framework are a bit more complicated than the examples here because they handle conditions not discussed here. These include an optional sname argument, and the ability to handle compound command line options, e.g. arg_output_file being specified by --output-file instead of --output_file. I use parts of the Boost::Preprocessor library to support these things. The framework also uses additional features of Boost::Program_options, including passing arguments via a file and using positional arguments.

Try it out and let me know what you think.

Research Blogging Roundup

Mailund on the Internet: Heads or tails and reliable alignments

In this paper they analyse the quality of multiple sequence alignments in an extremely simple manner: They first align the sequences left to right, then reverse them to essentially align them right to left. Unless the alignment algorithm has a preferred order of symbols, you’d expect to get the same alignment going left to right as right to left.

Not always, of course: if the algorithm is based on oligonucleotides or such, then the order matters, but in many cases it doesn’t.

Greg Laden: Genetics of Behavior: Fire Ants

Solenopsis invicta, a fire ant, can have colonies with a single reproductive queen (these are called mongyne colonies) or a colony wit multiple reproductive queens (called polygyne colonies).

In mongyne colonies, all individuals have a particular allele for one gene. The gene is General Protein-9 (Gp-9), and the allele is the B-like allele.

Polygyne colonies contain individuals with both the B-like allele and the b-like allele (case matters!). This has led to the suggestion that the presence of b-like is necessary and sufficient for the rise of polygyne colonies.

March Mathness

This year I’m participating in an alternative March Madness pool, described in this 2001 paper. But before I get into it, I just want to recommend that you all go read this article about the Georgia’s Coach Felton, which describes how much his player’s academics matter to him and the athletic department.—He kicked his two top scorers off his team before the season began because they wouldn’t go to class!—I was glad to see the tournament tornado shut up his critics for now so he can continue to dig the team out of from the mess that Coach Harrick left.

The idea of our pool is that players have a dollar to spend to buy teams, and they get 1 point for every victory their teams win. The player with the most points at the end of the tournament wins. Sounds easy right? Well choosing your teams is no simple task because higher seeds cost more than lower seeds, so buying a bunch of lower seeded teams might be better than buying a handful of top seeds. Here is the price scheme that we’re using.

Seed 1 2 3 4 5 6 7 8 9 10 11 12 13–16
Cost 0.25 0.21 0.18 0.15 0.12 0.10 0.08 0.06 0.05 0.04 0.03 0.02 0.01

As the paper points out, what is important in choosing your team is minimizing cost per win. Picking the best number one seed is likely to get you 5 or 6 wins for you $0.25. On the other hand, you could pick all 12th, 13th, and 14th seeds for $0.16 and get 3 or 4 wins, and have money left over to pick some 10th seeds. In the paper, they analyze fifteen years worth of NCAA tournaments and come up with an effective strategy to choosing your team. According to them, you should take a 1st seed and all 6th, 10th, 12th, 13th, and 14th seeds along with an 11th seed or three 15th seeds. You can read the paper for more details.

I used their strategy as a starting point for choosing my teams, but I adjusted it based on who I felt was more likely to win in the first round. I ultimately picked 18 teams:

  • 1 UCLA
  • 6 Oklahoma
  • 6 USC
  • 6 Marquette
  • 6 Purdue
  • 7 Butler
  • 10 Davidson
  • 10 Saint Mary’s
  • 10 Arizona
  • 11 Kansas State
  • 12 George Mason
  • 12 Villanova
  • 12 Temple
  • 12 Western Kentucky
  • 13 Siena
  • 13 Winthrop
  • 14 Georgia
  • 14 Cornell

After the first two rounds of the tournament, I’m in the lead with 14 points and still have four teams (the ones in bold) in the tournament. However, three people have 12 points and five teams remaining. They all chose two number one teams—UNC and UCLA—and thus have an advantage on me right now. So I just have to root for UNC, West Virgina, and Stanford to lose next round if I’m going to maintain my lead. Go Cougars!

Below is an email that I received from NESCent:

Phyloinformatics Summer of Code 2008

Please disseminate this announcement widely to appropriate students at your institution

The National Evolutionary Synthesis Center (NESCent) is participating in 2008 for the second year as a mentoring organization in the Google Summer of Code. Through this program, Google provides undergraduate, masters, and PhD students with a unique opportunity to obtain hands-on experience writing and extending open-source software under the mentorship of experienced developers from around the world.

Our goal in participating is to train future researchers and developers to not only have awareness and understanding of the value of open-source and collaboratively developed software, but also to gain the programming and remote collaboration skills needed to successfully contribute to such projects. Students will receive a stipend from Google, and may work from their home, or home institution, for the duration of the 3 month program. Students will each have one or more dedicated mentors with expertise in phylogenetic methods and open-source software development.

NESCent is particularly targeting students interested in both evolutionary biology and software development. Project ideas (see URL below) range from visualizing phylogenetic data in R, to development of a Mesquite module, web-services for phylogenetic data providers or geophylogeny mashups, implementing phyloXML support, navigating databases of networks, topology queries for PhyloCode registries, to phylogenetic tree mining in a MapReduce framework, and more.

The project ideas are flexible and many can be adjusted in scope to match the skills of the student. If the program sounds interesting to you but you are unsure whether you have the necessary skills, please email the mentors at the address below. We will work with you to find a project that fits your interests and skills.


Email any questions, including self-proposed project ideas, to [Enable javascript to see this email address.].

To Apply

Apply on-line at the Google Summer of Code website, where you will also find GSoC program rules and eligibility requirements. The 1-week application period for students opens on Monday March 24th and runs through Monday, March 31st, 2008.

Hilmar Lapp and Todd Vision US National Evolutionary Synthesis Center


Darwin’s Real Dilemma

This week’s Squidbillies is The Appalachian Mud Squid: Darwin’s Dilemma. It’s a “study of the migrations and libations of the ignorant redneck land squid.”

And, yes, those are scientific, individual tracking tags.

Pwned by Evolution


Tiffany was pwned by evolution this morning when she got three wisdom teeth removed.


She is currently resting while I tend to her every thirty minutes for the next six hours.

I’m sure many of you know what she is going through. I had all four of my wisdom teeth removed in high school, but I hardly remember a thing because of the horse pills that I was taking for the pain.

Pen Ultimate Thursday


Robotic Ball Launcher

Now playing fetch is even easier:

Red-light Cameras Increase Crashes, Florida Researchers Find

Rather than improving motorist safety, red-light cameras significantly increase crashes and are a ticket to higher auto insurance premiums, researchers at the University of South Florida College of Public Health conclude. The effective remedy to red-light running uses engineering solutions to improve intersection safety, which is particularly important to Florida’s elderly drivers, the researchers recommend.

Tournament Tornado

Well Coach Felton put together an unexpected and historic run for the Georgia Bulldogs through the SEC tournament. Not only did Georgia win four SEC games in four days after winning only four conference games all season, they won two in a single day, and they did it with only nine players. Georgia is a very shallow team, yet they managed to out hustle and out play their deeper competition.

After kicking its top two scorers off of the team this year, the Bulldogs struggled to find an identity. Their weak non-conference schedule didn’t prepare them for conference play. But at the eleventh hour, Georgia managed to find their identity and punch a ticket to the dance.

And here is probably the play of the tournament:

MCMC Convergence Tool

My friend Paulo Nuin has an article up highlighting a new tool for testing the convergence of MCMC chains: Are we there yet? Pretty much.

AWTY is pretty simple interface, the simple here being a compliment. No frills and easy to use. Basically the whole process can be summarized by:

upload tree file(s) -> select analysis type -> click Plot -> check result

Here is a follow up to my previous post:

How Big will this Check Be?

Woman Left For Four Nights In Washington County [Ar.] Courthouse Cell

A [new] bailiff forgot to remove a defendant from a courthouse holding cell last week, forcing the woman to spend four nights in a locked room without food, water or a toilet, the Washington County Sheriff’s Office said.

Pen Ultimate Thursday



Armed Robberies on Campus

We’ve had two armed muggings on campus this week near where I work. The one yesterday occurred in broad daylight in the parking lot outside our building. There have also been a recent rash of break ins in the immediate area as well. I’ve lived in Raleigh for a year and a half now and this activity seems highly unusual for this neighborhood.

Police Search for Robbers on N.C. State Campus

I suspect these are connected to a single gang of thugs that has decided that our area is now part of their territory.

Why you should get a Wii

Another Gamer Screwed by Microsoft:

So he called beforehand and was told he would receive his exact console back. He also included a letter just to cover all his bases. I bet you think you know what happens next. If you were to guess that Microsoft sent him a different plain white console back, you would be wrong.

They sent him his Xbox 360 back. The front serial number and the back serial number match up exactly. So what is the problem then? Someone at the repair center took the time to clean his console case. Despite the fact that the repairs that needed to be done were inside the console, someone wiped down the outside of the case. Wiped it down so well in fact that all of the signatures and artwork are completely gone. All that is left are some smudges and the unmistakable purple-ish hue of diluted permanent ink.

Someone didn’t get the memo.

Apparently, airport security hasn’t been briefed on the new laptop technology out there. Who new Apple was making suspicious devices?

I’m standing, watching my laptop on the table, listening to security clucking just behind me. “There’s no drive,” one says. “And no ports on the back. It has a couple of lines where the drive should be,” she continues.

Steve Jobs Made Me Miss My Flight

Sunday Lolcat

Saturday Lolcat

What’s that Saying?


We’re under water restrictions in Raleigh, so in our house we use that old saying to conserve water in the bathroom. How does it go again?

If it’s yellow, leave it mellow.

If it’s blood, call 9-1-1.

Nah, I don’t think that is right.

Here is another javascript blogging trick for you. We’ve been using it for many years on the Panda’s Thumb, and we recently debugged a problem some browsers had with it. Like my previous ones, this one was recently updated to work with the jQuery javascript library.

In this trick, whenever your users read an entry via the ‘#comments-new’ anchor, their browser will jump them to the last comment that they read. The browser knows which comment to jump to because it store a cookie last time they visited the page. To get this to work with Movable Type 4 you will need to first upload jquery.js and modify your header template module. Insert the following line between the <head></head> tags.

 <script type="text/javascript" src="/URL/TO/jquery.js"></script>

At same time it might be best to replace MovableType’s use of the onload command with a call to jQuery’s ready event. Simply add the following lines before the </head> tag:

<MTIf name="body_onload">
<script type="text/javascript" language="javascript">
$(function(){<$MTGetVar name="body_onload"$>});

Also remove the <MTIf name="body_onload">... tag from the <body> tag. This should provide better performance and compatibility with the rest of my javascript tips.

Now for the magic. Edit your Comments template module and add the following text before the first <MTComments> tag.

<mt:Unless name="comment_preview_template">
<div id="comments-new"></div>
<script type="text/javascript" language="javascript">
	var now = new Date();
	var cook = getCookie('last_comments_a');
	var hid = (cook) ? eval(cook) : new Object();
	for(var k in hid)
		if(hid[k][1] < now )
			delete hid[k];
	now.setTime(now.getTime() + 7*24*60*60*1000);
	var cid = 0;
<mt:Comments lastn="1">
	cid = hid[<mt:EntryID/>];
	hid[<mt:EntryID/>] = [<mt:commentid>, now.getTime()];
	var src = (!Object.prototype.toSource) ? objSource(hid) : hid.toSource();
	setCookie('last_comments_a', src, now,'/','','');
	if( window.location.hash == '#comments-new')
		window.location.hash = (cid) ? '#comment-' + cid[0] : '#comments';

And finally, edit your Entry Metadata template module and replace #comments with #comments-new.

So now whenever someone clicks the comments tag, it will direct them to #comments-new which will trigger the script to jump them to the last comment read or the first comment on the page.

I was recently made aware of the fact that this solution was broken on Opera and maybe other browsers. Therefore, you may want to add the following lines to your Javascript index template to work around limitations of such browsers.

function objSource(obj) {
	switch (typeof obj) {
	case 'number':
	case 'string':
		return obj.toString();
	case 'object':
		var str = [];
		switch(obj.constructor) {
		case Function:
			return 'null';
		case String:
		case Number:
			return obj.toString();
		case Array:
			var i=0,j=obj.length;
			while(i<j) {
			str=['[',str.join(', '),']'];
			for(var i in obj){
				var v = objSource(obj[i]);
				if(typeof(v) != 'undefined') {
			str=['({',str.join(', '),'})'];
		return str.join('');
	return 'null';

And knowing is half the battle.

New Toy



Colorblind-Enabled Graphics

Some time last year one of the students mentioned the question of designing figures and presentations for colorblind members of the audience. (With the way academics dress, you’d think there were a lot of them.) I can’t remember what was said about the rules for designing such figures, but I do think about it now and then: “Should I really mix reds and greens in this important figure?”

In that vein, I came across an interesting article about game design for the chromatic-impaired: “Ramblings of a colorblind gamer.”

You know Rockstar Games presents Table Tennis? Is that game any good? Because I wouldn’t know.

Table Tennis relies very heavily on the player’s ability to see the color of the ping pong ball’s trail. If the ball leaves a green streak in the air, it’s got forward spin. If it’s got a yellow streak, it’s got backspin. That’s what it seems like to you, anyway: to me, there is only the blue streak and then three other ball trails of identical color which I cannot, in my wildest dreams, hope to differentiate between. There are very subtle visual cues to differentiate forward spin from backspin, but they don’t give the player the immediate visual feedback a simple color does.

When I tried to play Table Tennis the first time, I immediately noticed the color-based spin system and, despite my best attempts (in this context, “best attempts” means “continually hitting the downspin button and cursing violently when my shot doesn’t work the way I want it to”), I got my ass handed to me by my non-mutated friends.

The Original Gator Hator

I am a huge fan of Squidbillies. I love their humor because they use a lot of jokes that depend on knowing about Georgia and the Deep South in general. I’m sure jokes about the Cyclorama, Stone Mountain, Awesome Bill from Dawsonville, and David Allan CEO are lost on lots of people, but much of their humor is spot on.

In this week’s episode, we find that the Cuyler clan has a favorite football team in a scene that I absolutely love.


“Herschel Walker Cuyler Them Dawgs Is Hell Don’t They”—Haha

Ben Affleck?!

And here is the response to the previous video. If you haven’t watched the video on Saturday’s post, please watch it first.

Note: Probably not work safe.

The part with “Indiana Solo” makes the entire video, don’t ya think?

Matt Damon?

This is the first of two videos that I am posting this weekend. Many of you have already seen it.

Note: Probably not work safe.

About this Archive

This page is an archive of entries from March 2008 listed from newest to oldest.

February 2008 is the previous archive.

April 2008 is the next archive.

Find recent content on the main index or look in the archives to find all content.


Powered by Movable Type 4.37