Monday, July 4, 2016

Things you need to know for writing a thesis or dissertation in Microsoft Word: Styles, Style breaks, Tables of Contents, and more!

In writing my dissertation, I've had to become more familiar with some of the more advanced features of Microsoft Word (I know, I know, I should be using LaTeX, but that's just not what people in my field use...). Here are a few of the most critical tricks I've learned. I hope this is helpful to other people as they write long documents like theses and dissertations. The screenshots here are from Word 2016, but all of these things are very similar on Word 2010 and 2013.


Sunday, July 3, 2016

Random discrete distributions (decks) in game development

Randomness plays an important role in many games. Enemies appear randomly, or events occur at randomly spaced intervals. A relatively easy way to think of random events in a game is as a deck of note cards. The probability of a particular word being drawn is a function of the number of cards in the deck with that word on them, and the total number of cards in the deck.

This approach is called a discrete distribution.

In the case of circle the aardvark, I used a discrete distribution to determine whether an aardvark or an enemy spawned, and how long each character should remain on the screen before timing out and going away.

The game is written in Monkey X, but the code in this post is in Python.
You can find the Monkey X version here.


Read on for details

Tuesday, June 21, 2016

Can compassion ever be powerful enough to stop terrorists?

Our country and our world keep experiencing devastating and seemingly senseless acts of mass violence. Some of the violence is committed by people who are clearly mentally ill. But a shocking amount of mass violence is committed by rational people who know exactly what they are doing. My ideological heroes, like L.L. Zamenhof, Amon Hennacy, and Leo Tolstoy, were strong proponents of non-violence, even to the point of pacifism.

In my life as a middle class American (that is: incredibly wealthy compared to the world-wide norm), I've never really experienced the threat of violence, so perhaps I'm a little rosy-eyed and unrealistically idealistic. But it seems to me that our strongest weapon against violence is, and will always be, compassion.


Here's a poem that kind of addresses these issues. I wrote it after reading the article “Young Lives, Lost in the Fog of War” by Rod Nordland in the Sept. 15 2012 New York Times.

I'd be remiss if I didn't also credit the inspiration of the Flaming Lips, and their performance at the Oklahoma City Zoo, and Bart Budwig for a line I stole from one of his songs.

Monday, June 20, 2016

Code Release: Circle the aardvark in the back of the pickup truck

A while ago I made a game called: Circle the aardvark in the back of the pickup truck. Now, by popular demand (or just because I felt like it...), I've posted the code and resources for public download. I think there's a lot of potential for using the core mechanic (circling things) for other games for touch devices. I intend to do a series of posts explaining some of the important or innovative aspects of the code.

In the meantime, the code can be found here.

Topics I hope to cover are:
Discrete random distributions
How to know when a circle (n-gon) is closed
How to know which objects are inside a closed circle.
Global timer control
High scores tracking with php and an sqlite database

Sunday, June 12, 2016

Assembling the Mentha Longifolia genome

A group of researchers, including myself, recently made a draft genome assembly for Mentha longifolia. The publication for which is currently under review. This post is my notes for my part of that effort. Basically that means that this is my lab notebook for part of the summer of 2014. It's pretty disorganized and may or may not be useful to anyone ever....


Long story short:
I was trying to figure out how to integrate PacBio reads with Illumina reads.
In the end, I used ECtools to correct the PacBio reads, and then used PBJelly to merge the PacBio reads with an assembly generated from the Illumina reads. It is my understanding that there may be better options for PacBio error correction today, but at the time ECtools seemed to be the best.

Read on for the juicy details....

Saturday, June 11, 2016

Why I think that pondering the existence or non-existence of God is a waste of time

I usually describe my religious views as "strong apatheist", which means that I think it doesn't matter whether God exists or not, and I think I can prove that it doesn't matter.

This post is meant to explain and defend that position (my first comment below is a much more concise defense than the post itself, you could save yourself a lot of time by skipping this post and just reading that comment instead).

This post is also partly meant to elicit defensive responses from Christians (particularly those who are not some kind of universalist), so if you fall into that category, and if you've thought more carefully about this topic than I have, please leave a rebuttal in the comments.

It was originally written as a reply to a post on Facebook, so please excuse the scars it retains from its origin.

Sunday, May 8, 2016

building an interactive tree with d3.js php and sqlite: an annotated webliography

I want to make a tree with rectangular nodes containing text, such that I can add nodes or remove nodes on the fly. I want the tree to be "multiplayer": everybody who visits the site sees the same tree, and when one of them modifies it, it the updates are applied to everyone's view.
I know nothing about d3, and very little about PHP, but a bit about sqlite and Apache.
For this project I'm using a minimal number of libraries, and a very simple server setup, which leads to some inefficiencies. The server is Ubuntu 14.04 with Apache 2.4 with PHP 5.6. Client side the only library I'm using is d3.js 3.5.

A consequence of the simplicity is that I don't have a good way to push data to clients, so I can't use long polling or web sockets. Instead, I rely on repeated client requests for updates, which adds some latency, but hopefully not too much.


Requirements for graph:
Nodes are boxes that can contain about 50 words
terminal nodes can be added or removed (capability to add or remove internal nodes is not necessary)
root is on the left
subtrees can be expanded or collapsed
zoom-in zoom-out capability
pan capability
sort nodes with the older siblings above newer siblings


Let's get this figured out!