Is Descriptive Eloquence Inherited?
Posted by Scott on November 24th, 2008 at 8:09:04 PM | 333 words | No Comments »
I’m quite proud of the general diction used through my blog. Although my brain can only recall exact phrases and ideas from recent entries, I think about my writing style (casual, yet indistinctly formal - a recipe for “intelligent” text?) and smile. I know I will always be imperfect, and surely there are numerous grammatical, spelling, and logic errors in my posts. Nonetheless, I’m proud of my work, and I’m very thankful that I have a quasi-organized, chronological, semi-continuous (and continuously backed-up) account of my thoughts going back to 2001, over 7 years ago! Although many of my current philosophies and views about life, love, and open source software remain the same, I’m evermore surprised at the stark contrast between my current ideology and the concepts expressed in some of my older writings (use Google to find my entry on “the corporation”, obviously written when I was irritated about someone - it’s about as anti-capitalistic as one could imagine!). I must digress; the only reason I wrote this entry tonight was to quote myself from October, 2002 (over 6 years ago - I just turned 17, and was a Jr. in high school). I was describing [in my mind what was a] catastrophic event: the accidental deletion of my file storage computer / web server’s entire hard drive. I’ll let the words speak for themselves.
| “I am now in the process of trying to rebuild what I have lost. The many hours I have put into my websites has now deminished to nothing but some heat to be cast into the atmosphere by my heat sink.”
–Scott Harden (me) at age 17 |
How creative was I? Okay, so I was no Homer. Maybe I’m just being sentimental, but I still think that’s a beautiful over-literal description of how my life was deleted - “cast into the atmosphere by my heat sink” - it’s so cool! For those of you less computer savvy, a heat sink is what cools the main microchip in your computer.

Compress Strings and Store to Files in Python
Posted by Scott on November 24th, 2008 at 5:48:16 PM | 223 words | No Comments »
While writing code for my graduate research thesis I came across the need to lightly compress a huge and complex variable (a massive 3D data array) and store it in a text file for later retrieval. I decided to use the zlib compression library because it’s open source and works pretty much on every platform. I ran into a snag for a while though, because whenever I loaded data from a text file it wouldn’t properly decompress. I fixed this problem by adding the “rb” to the open line, forcing python to read the text file as binary data rather than ascii data. Below is my code, written in two functions to save/load compressed string data to/from files in Python.
import zlib
def saveIt(data,fname):
data=str(data)
data=zlib.compress(data)
f=open(fname,'wb')
f.write(data)
f.close()
return
def openIt(fname,evaluate=True):
f=open(fname,'rb')
data=f.read()
f.close()
data=zlib.decompress(data)
if evaluate: data=eval(data)
return data
Oh yeah, don’t forget the evaluate option in the openIt function. If set to True (default), the returned variable will be an evaluated object. For example, “[[1,2],[3,4]]” will be returned as an actual 2D list, not just a string. How convenient is that?

Run Ubuntu Live CD From a USB Drive
Posted by Scott on November 22nd, 2008 at 3:36:16 PM | 181 words | No Comments »
I accidentally nuked my laptop’s 80G hard drive this morning (D’OH!) while shuffling around partitions. Supposedly there’s a valid windows (XP) installation on there still that’s about 20G. I’d love to repair it so I can use it today while I’m in the confocal room, but I don’t have an Ubuntu CD, Windows CD, or any CD for that matter! I looked around, but I guess blank CD-Rs aren’t something that’s standard in molecular biology laboratories. Anyhow, I wanted to install the new Ubuntu 8.10 Linux distribution, and I’ve downloaded the ISO, but since I can’t find a CD to burn it to I decided to try booting from a USB drive (something I’ve never done before). I found an AWESOME program which specialized in putting ISO files onto bootable USB drives. It’s called UNetBootin and it’s free (of course), runs on Linux or Windows, and has some built-in options for various linux distributions. I can repair my PC now! Yay!


Linear Data Smoothing in Python
Posted by Scott on November 17th, 2008 at 2:50:10 PM | 789 words | 1 Comment »
Here’s a scrumptious morsel of juicy python code for even the most stoic of scientists to get excited about. Granted, it’s a very simple concept and has surely been done countless times before, but there aren’t any good resources for this code on the internet. Since I had to write my own code to perform a variety of different linear 1-dimensional array data smoothing in python, I decided it would be nice to share it. At the bottom of this post you can see a PNG image which is the file output by the code listen even further below. If you copy/paste the code into an empty text file and run it in Python, it will generate the exact same PNG file (assuming you have pylab and numpy libraries configured).
### This is the Gaussian data smoothing function I wrote ###
def smoothListGaussian(list,degree=5):
window=degree*2-1
weight=numpy.array([1.0]*window)
weightGauss=[]
for i in range(window):
i=i-degree+1
frac=i/float(window)
gauss=1/(numpy.exp((4*(frac))**2))
weightGauss.append(gauss)
weight=numpy.array(weightGauss)*weight
smoothed=[0.0]*(len(list)-window)
for i in range(len(smoothed)):
smoothed[i]=sum(numpy.array(list[i:i+window])*weight)/sum(weight)
return smoothed
Basically, you feed it a list (it doesn’t matter how long it is) and it will return a smoother version of the data. The Gaussian smoothing function I wrote is leagues better than a moving window average method, for reasons that are obvious when viewing the chart below. Surprisingly, the moving triangle method appears to be very similar to the Gaussian function at low degrees of spread. However, for huge numbers of data points, the Gaussian function should perform better.

### This is the code to produce the image displayed above ###
import pylab,numpy
def smoothList(list,strippedXs=False,degree=10):
if strippedXs==True: return Xs[0:-(len(list)-(len(list)-degree+1))]
smoothed=[0]*(len(list)-degree+1)
for i in range(len(smoothed)):
smoothed[i]=sum(list[i:i+degree])/float(degree)
return smoothed
def smoothListTriangle(list,strippedXs=False,degree=5):
weight=[]
window=degree*2-1
smoothed=[0.0]*(len(list)-window)
for x in range(1,2*degree):weight.append(degree-abs(degree-x))
w=numpy.array(weight)
for i in range(len(smoothed)):
smoothed[i]=sum(numpy.array(list[i:i+window])*w)/float(sum(w))
return smoothed
def smoothListGaussian(list,strippedXs=False,degree=5):
window=degree*2-1
weight=numpy.array([1.0]*window)
weightGauss=[]
for i in range(window):
i=i-degree+1
frac=i/float(window)
gauss=1/(numpy.exp((4*(frac))**2))
weightGauss.append(gauss)
weight=numpy.array(weightGauss)*weight
smoothed=[0.0]*(len(list)-window)
for i in range(len(smoothed)):
smoothed[i]=sum(numpy.array(list[i:i+window])*weight)/sum(weight)
return smoothed
### DUMMY DATA ###
data = [0]*30 #30 "0"s in a row
data[15]=1 #the middle one is "1"
### PLOT DIFFERENT SMOOTHING FUNCTIONS ###
pylab.figure(figsize=(550/80,700/80))
pylab.suptitle('1D Data Smoothing', fontsize=16)
pylab.subplot(4,1,1)
p1=pylab.plot(data,".k")
p1=pylab.plot(data,"-k")
a=pylab.axis()
pylab.axis([a[0],a[1],-.1,1.1])
pylab.text(2,.8,"raw data",fontsize=14)
pylab.subplot(4,1,2)
p1=pylab.plot(smoothList(data),".k")
p1=pylab.plot(smoothList(data),"-k")
a=pylab.axis()
pylab.axis([a[0],a[1],-.1,.4])
pylab.text(2,.3,"moving window average",fontsize=14)
pylab.subplot(4,1,3)
p1=pylab.plot(smoothListTriangle(data),".k")
p1=pylab.plot(smoothListTriangle(data),"-k")
pylab.axis([a[0],a[1],-.1,.4])
pylab.text(2,.3,"moving triangle",fontsize=14)
pylab.subplot(4,1,4)
p1=pylab.plot(smoothListGaussian(data),".k")
p1=pylab.plot(smoothListGaussian(data),"-k")
pylab.axis([a[0],a[1],-.1,.4])
pylab.text(2,.3,"moving gaussian",fontsize=14)
#pylab.show()
pylab.savefig("smooth.png",dpi=80)
Hey, I had a great idea, why don’t I test it on some of my own data? Due to the fact that I don’t want the details of my thesis work getting out onto the internet too early, I can’t reveal exactly what this data is from. It will suffice to say that it’s fractional density of neurite coverage in thick muscle tissue. Anyhow, this data is wild and in desperate need of some smoothing. Below is a visual representation of the differences in the methods of smoothing. Yayness! I like the gaussian function the best.

I should note that the degree of window coverage for the moving window average, moving triangle, and gaussian functions are 10, 5, and 5 respectively. Also note that (due to the handling of the “degree” variable between the different functions) the actual number of data points assessed in these three functions are 10, 9, and 9 respectively. The degree for the last two functions represents “spread” from each point, whereas the first one represents the total number of points to be averaged for the moving average. Enjoy.

Free Damask Seamless Tiling Backgrounds
Posted by Scott on November 16th, 2008 at 11:47:43 PM | 289 words | 1 Comment »
If you’re in the mood for some 18′th century textile patterns you’ve stumbled upon the right place! Surprisingly, it’s incredibly difficult to find functional (seamless, tiling, free) damask-style patterns on the internet. If you don’t believe me, just Google / image search for it! It took me over an hour to find a functional pattern that tiled properly. Actually, to correct myself there, the image I downloaded didn’t even tile correctly!!! I had to manually modify it to make it seamless. So, free for all website makers, webmasters, wallpaper collectors, and Louis XVI enthusiasts: I give you a plethora of different colors of damask-style tiling backgrounds for whatever you want to do with it!

It’s Just Molecules, They’re Not People
Posted by Scott on November 13th, 2008 at 1:25:52 AM | 1,209 words | 1 Comment »
Okay, right off the bat there are a few shocking questions you may have. First, you’re probably wondering how I could possibly be writing again so soon, a mere matter of hours after posting my previous entry - a surprising action noting that it’s been almost a month since my presequent (the opposite of subsequent?) entry. To understand why, read the subsequent paragraph. Second, you may have noticed the awkward title. This was actually a quote from my organic chemistry professor. Without question, it was the most significant thing the man ever said in class. I believe it is also the only thing he said that I actually retained from that class - supported by the fact that I cannot even vaguely remember the context in which it was uttered (perhaps when he used a molecule attraction / people dating analogy to describe what happens when two atoms in a bond interact with another molecule which is more attractive to one of the atoms?). Organic chemistry emulsified my brain. Ha! That’s a good quote right there. For the record, an emulsion is what happens when an organic (oil-like) solution is mixed with an aqueous (water-like) solution (they don’t really mix) and then violently shaken to form millions of little tiny oil beads in water. Emulsions are very hard to break up, if not impossible. Milk is an emulsion, and I think you have to heat it up to get it to separate. Reminds me of my dorm room refrigerator actually…
The reason I decided to write again is because I’ve actually been feeling guilty about my last entry. Yeah, I know. I’m not one to flippantly use words that I later regret on this weblog. However, while sitting here in the confocal microscope room scanning slides and blogging in the time gaps caused by the 10 minute exposure time, I began pondering my attitude during the last entry. I described myself as “that annoying coworker”, and even voiced my frustration about dental school, ultimately noting that I understand no one reads this weblog anymore. Then I stopped to think about that last part… Why do i care who reads this?
Yeah, I used to have this super-active website several years ago, where I’d brag about having five thousand new IP visits a month, but in retrospect it seems so fickle. I thought that this website made me so much more mature than the high school football players and cheerleaders who did little more than gloat in their own popularity, but there I was obsessing about how many people read my blog, how many comments I got on each post, and how many people were willing to donate their lives to beta test new versions of AIM hacking software. Wow, it’s been a while since I mentioned that. Venomcrack? AimPoo? AIM_H4X0R? Takes me back…
So, I began to feel guilty. The purpose of these writings must be the same now as it was in the beginning. The concept must come around full circle for it to work. I write for myself alone. If my writings benefit others in the way of advice, new contacts, or even simple amusement that’s great - but it can’t be why I write, and it can’t be my motivation. My desire to write is merely to ventilate trite emotions that are either too subtle or too complex to be worth explaining to somebody out loud. Additionally, my writings serve as a lens of perspective. Remember in the last paragraph how I talked about how I wrote about something that, years later, I read and ask myself “what was I thinking?” I think we could all use a reminder to take a step back in our opinions and ideas for a little while, and really place themselves in the big picture. Practically every entry over a couple years old has the same effect - I read it and squirm. Was I really that way? Did I really think that? How could I say those things? It’s a constant reminder that who I am now is probably similar, and other people look at me now the same way that I will look at myself in the future, which is probably similar to the way I think now about how I wrote in the past. Anyway, to add to the guilt I felt about writing how no one reads this anymore, when I logged in just now to write this I saw that someone actually left a comment! (thanks Kyle _) It blew me away. Google analytics claims that I get about 4 visitors a day. I’m sure they’re disappointed googlers who are looking for something completely different than a personal weblog too. Anyway, cool stuff!
Hey, Kyle… since you’re probably the only one reading this (lol) I’ll write you a public, personal email. You should make a website of your own! I kind of disowned everybody I knew from my past, and the friends I did have with blogs stopped blogging. It’d be cool - we could build off of each other’s posts, ya’ know? Just a thought. I think WordPress allows you to make your own blog form their website so you don’t need to buy anything. And you get to be like Scott! I use WordPress =o)
Late nights in the laboratory make me sad. Yes, I have to work on my thesis so I can graduate, and yes I’m getting paid for my work, but at the same time I know I have a responsibility to my family (which pretty much just consists of my wife right now). I feel guilty when I’m gone late at night. I try to make maximum use of my time by working the ENTIRE time she goes to work (if she’s ever at work, I use it as a guilt-free opportunity to get my work done int he lab). On top of that, I put in random hours on weekdays, nights, and weekends. I try to do the best I can by coming home in the afternoon when she gets off work so we can spend a few hours together and eat lunch or dinner together, but whenever I leave again I feel guilty. Similar to the feeling I described earlier about fighting the notion that I’m “that annoying coworker”, I’m currently fighting the notion that I’m “one of those obsessive workaholics”. Just like I know I tend to be annoying sometimes, realize that I am obsessive sometimes. However, I’ve been working in the same laboratory on the same project for over a year. Am I obsessing about graduating? What level of hard work is excluding your family? How hard am I expected to work toward my degree, and how is this supposed to balance with my family? My wife claims she doesn’t really care, but I do. She goes out at night some days and doesn’t get back until early in the morning and she doesn’t seem to care, so why should I? I guess it’s guilt. Perhaps I don’t feel guilty initially, but then later I feel guilty for not feeling guilty. It’s the replacement of care for logic - it always produces uneasiness.

Glorious Intolerable Monotony
Posted by Scott on November 12th, 2008 at 5:25:04 PM | 559 words | 1 Comment »
The funny thing is that at one point in the last several months I actually toyed with the idea of writing here regularly. I apparently had yet to come to the realization that, despite being actively engaged in two-way communication with regular readers of this website in years long past, this content-starved shell of a weblog is more of a mortuary than anything else.
This, of course, is only solidified by the content I’ve been adding recently - little more than diatribes of frustrated research projects in the laboratory sprinkled with qualms about the monotony of studying molecular biology at the graduate level.
You know the stereotypical coworker who does nothing but talk about life at work even with you spend time with them away from work? …the people who, whether intentional or not, can’t seem to separate their job from their free time? …the people who, even when they have the opportunity to get away from something they supposedly hate, only desire to think about the very thing they’re trying to get away from? Yes, I feel like one of those people. Getting back to the contrived notion that this website would one day be revitalized, I have to simply accept the fact that, for now at least, this is all it will be. I simply don’t have the time to write happy and cheery stories about my everyday life. Instead, I only described the “breakthrough events” that lie punctuated on the timeline of my recent life. The irony of course is that all of my life breakthroughs seem to be those regarding my research, my school, or my career (the three of which have become disturbingly unseparable recently). In other words, I realize I’ve become “that annoying coworker”, but just because I know this doesn’t mean that I want to (or have the ability to) change my thoughts.
I’ve been invited to dental school interviews! Yayness. With an emotional palette of feelings somewhere between skipping beneath confetti and balloons falling from the sky and the tingly feeling of flesh-eating leaches gnawing from behind my eyes, I prepare for interviews at the two dental schools I’ve heard back from so far. I applied to 4 schools but haven’t heard back from the other two yet. Luckily, the two I have heard from are those I’d be most likely to attend. Anyhow, I get to prepare to cheerfully answer questions like “Why do you want to become a dentist?”, “Why do you want to attend dental school at our university?”, and “How do you feel about potentially becoming irreversibly locked into a career you only posses lukewarm passing interest in?”. I promised I’d post my application essay on this website. I’ll probably wait until I’m either accepted or rejected by the schools I’m interested in, that way I can’t be accused of copying anything. Wouldn’t it be interesting if they did a web-based plagiarism check on my essay and it found a hit from my own webpage - but they didn’t take the time to realize it was my webpage?
Here’s some “breakthrough” eyecandy:< 

« Previous Entries | Next Entries »






