Caffeine Wean

I’ve dosed myself with caffeine every morning since I was 8. If I don’t have a dose within ~1 hour of waking up, I get a headache that will not leave until the next morning. The caffeine was originally a medication for migrations that had no clear source. Now it isn’t clear if I still get those same idiopathic headaches but caffeine treats them, or if I have just swapped whatever that problem was for a caffeine addiction that gives me headaches during withdrawal. I’ve attempted to kick the habit a few times in the past, but these always ended poorly. So, I decided to try again but with academic rigor so as to decide for good whether my headaches are withdrawal-induced or caffeine-treated.

Hypothesis: My headaches are caused by withdrawal from caffeine, a substance that I am addicted to.
Alternative Hypothesis: My headaches are due to some biological cause, and caffeine treats this undefined problem.

Experimental Approach: Attempt to slowly wean myself off of caffeine. If I can do this successfully and remain headache-free for an extended period of time, I will take this as evidence for a caffeine addiction. If I cannot, I will take this as evidence for a biological problem.

Today’s post explains exactly how I plan to do this, in academically painful detail (below the fold).

Continue reading

Leave a Comment

Filed under life, science

arduino: reaction time game

As I mentioned in a previous post, I am trying to teach myself some electronics. I’ve been perusing a pretty good book by Michael McRoberts called “Beginning Arduino”, and after putting together one of the first projects I decided to have fun with it and write some more interesting code than the one provided. The original scheme gave a series of three LEDs that would turn on as if they were a stop light, and then allow someone to press a button to get the light to change to red so that another LED, representing the pedestrian walk sign, could turn on. This wasn’t very interesting to me, so I made it into a reaction game instead otherwise using the same circuit. See the video immediately below, and the circuit diagram (made using Fritzing) and code below the fold.

Continue reading

1 Comment

Filed under computers/software, science

Breadboard 5V regulator

solarbotics breadboard voltage kit contents

Fig.1: Kit contents.

Since I intend to do a lot of fiddling with Arduinos, and because I need the soldering practice, I bought the breadboard voltage regulator kit (by Solarbotics) from Makershed. The kit is simple – it just requires the soldering of a handful of parts to the provided board. The instructions are super-clear, so even though I barely know what the parts are and only recently discovered that LEDs have to be connected in a certain direction, the task was easy. I did find, however, that I still totally suck at soldering, even after the purchase of a nicer iron. With time perhaps.

In the end, though it took me probably 5 minutes to solder each joint, I plugged the thing in and it works! This regulator is supposed to hold the voltage at 5V, which is perfect for the Arduino since that is what it outputs. Pretty handy little thing, and if you are a bit more knowledgeable you could make your own from scratch for way cheaper.

solarbotics voltage regulator kit built

Fig.2: Assembled kit, plugged in with glowing LED.

Leave a Comment

Filed under HowTo, science

Adventures in Electronics

I’ve wanted to be able to build small electronic devices for quite some time, but this is one of those areas in which my education is seriously lacking. I’ve gone through the Makershed Electronics Components Packs and the book that goes with them, but really only spent a weekend doing so. And that was a year ago. Now that my graduate school coursework is complete I’ve decided to do learn this stuff for real, and to mix it up with Arduino (an open-hardware microcontroller platform) . I’ll try to  regularly update this site with the electronics and Arduino projects that I go through. Most of them will be from kits, so this process will also serve to let readers know if the kits are worth while.

I’m writing this post on my new Asus Transformer Prime (with keyboard) and it just feels clumsy as hell. Probably that feeling comes mostly from the Android operating system, which makes text editing a difficult process. And the slowness of switching applications to find links or open other documents also makes this a pain. Perhaps I will get used to it and even begin to like this system over time, but for now I cannot recommend that anyone who wants to do any serious mobile writing (or coding) get one of these things. It seems you’re much better off with a small laptop.

Leave a Comment

Filed under life

Python: shared birthdays

A few days ago I found myself having a vague recollection of a statistics problem presented at some unknown level in my education. All I could remember was that it had to do with having a room full of people and the probability that any two people in that room would have the same birthday. I remembered the point, which was that it is much more likely than you might think, but I was fuzzy on the details.

After trying to define the problem and find an answer mathematically, I remembered that I suck at statistical reasoning about as much as the average American. So I decided to model the problem with a short Python script and find the answer that way.

The problem: There are n people (say, at a party) drawn randomly from a population in which the chances of having a birthday on any day is equal to having a birthday on any other (which is not true of real populations (probably)). What is the probability of there being at least two people with the same birthday in the sample?

To put this thing together, I figure we need three things:

  1. The ability to generate random numbers (provided by Python’s random module);
  2. An object representing each person;
  3. A party object full of those people.

Then we can add things like the ability to choose how many people we want at the party and how many parties to have, as well as some output for making plots!

First, the Person object. All each person needs is a birthday:

import random
random.seed()

class Person:
    def __init__( self ):
        self.birthday = random.randint( 1, 365 )

Continue reading

2 Comments

Filed under computers/software, science

cloning trick: ligation of multiple inserts

I’ve spent the last couple months building a plasmid library, and in the process I thought of a trick. Ligations, perhaps the worst part of cloning, are notoriously finicky reactions. The goal is to take several pieces of linear DNA, where the ends of the pieces can only connect in a certain way, and then use an enzyme (T4 Ligase) to sew them all together into one piece (in my case, a circular plasmid).

Figure 1. Ligase (2HVQ.pdb) rendered in PyMOL. Click to see a crappy animated GIF!

I needed to insert three fragments at once into a single backbone. In my ignorance (from my lack of experience) I thought ligating four fragments should work just as well as two, so I just threw them all together and ran the reaction. The result was a mess, and when I tested 40 different clones afterwards not a single one was correct. So I started adding them one piece at a time which, obviously, was going to take three times as long.

Continue reading

2 Comments

Filed under HowTo, science

secrecy and biological research

It is becoming increasingly clear to me that my ideal picture of “doing science” is following the fate of all ideals: death at the hands of reality.

While I was working away at WashU, preparing for graduate school, I imagined myself as a grad student. In that imagination land I was working my ass off, learning all kinds of things, and sharing every bit of that with others via this platform. My work would be totally open. In reality, I am doing only those first two things.

Every couple of days I have an awesome research experience or an interesting new idea and come home planning to write about it. Then I start thinking about how I can present the experience while maintaining the proper level of censorship. Perhaps unsurprisingly, my motivation always quickly evaporates. You may be wondering: why is there any censorship required at all?

Continue reading

1 Comment

Filed under life, science