Here you will find a collection of things I've worked on or found interesting and worthwhile to post. There is some poetry and other written works, as well as projects and programming thoughts/ideas/tips.

Performance of Clearing a StringBuilder

The other day at work I was working on a project where I would be creating lots of small strings. And by a lot, I mean a lot, on the order of 100s of millions. So, I was wondering what is the most efficient way to deal with using StringBuilder. Building the strings would require dumping the contents of the builders. There are three methods, reallocating a new string builder each time, using sb.setLength(0), or sb.delete(0, sb.length()). Being the empirical scientist that I am, I figured the only way to determine which is the fastest is to profile it.

Ints Vs. BitVector32: Speed Showdown

So I've been playing around the past few days with writing a simple 3D game. I can't tell you much about . . . sorry. I started off in Java using OpenGL. Things went fairly well considering 3D engines are not my strong suit and its a lot of learning. (And yes I looked at JME, but decided against it). Anyways, I decide that I'd try my hand at using XNA, which meant porting what I had from Java to C#. (I have this delusion of releasing it as an indie game one day on the 360). While porting I ran across my code where I used packed ints.

Sorting Arrays in PHP Using a Key Function

I've been flipping through the second edition of the "PHP Cookbook" by O'Reilly to see if there are any new tricks I can learn. I've worked with PHP quite a bit from small projects hacking Durpal to much larger ones such as a library management system, but there are always new things to learn.

AppleScript for Making Clipboard Contents Filename Ready

Today I wanted to go through my downloads folder and clean things up a bit. I have a lot of random pdfs in that folder with random names like "fulltext(1).pdf" and "fultext(9).pdf" (thanks IEEE eXplorer, or was that ACM) and others with equally informative names like "S1350482701003061a.pdf". Clearly these simply won't do. What should the filename be? Well the paper/documents title of course! If you open up the pdf and copy the title of the paper you can't paste it as the filename as it might have have undesirable characters in it, especially new lines.

Masters Thesis

In mid July 2010 I defended my thesis. The defense was followed by a rush to get my thesis revised and submitted by July 31. After the mad dash, a committee member that had more revisions than all the other four combined, and barely getting that member to sign in time, I finally printed my thesis and had it submitted to the graduate college. And yes, you read that correctly, I had five committee members on my ms committee.

Notice: No User Accounts Allowed

I have noticed several attempts to create accounts on this website. I don't know if these are legitimate or attacks, either way no one can register for an account on this site. 

XCode won't open a Project

Today I was trying to work on a project in XCode (which I'm very unfamiliar with) and it refused to open the project giving the following error:

 

Internal Error  
File:  /SourceCache/DevToolsBase/.../XCPlatformSpecification.m  
Line:  438  
Object:    
Method:  loadAllPlatforms  
The Mac OS X platform is missing - cannot set a default platform.

 

XKCD Inspired Google Results Grapher

This little program lets you create a bargraph of the number of results returned by a google search when replacing a small part each time. For example if you use Google Query: how to get better at <x> Search Terms: starcarft 2; kissing; cooking; robbing a bank; becoming cowboy neal It will plot the number of results returned by a google search when <x> is replaced by each search term. This means it would plot the number of results for each of "how to get better at starcraft 2", "how to get better at kissing", "how to get better at cooking" .... This was inspired by several XKCD comic strips like Numbers and Dangers. Of course, the numbers don't quite match up with the comics.
Google query "<x>" will be replaced:
accident')?>' size='70'>
Search terms to substituted into the above query (separated by semicolons):
' size='70'>
&google_options='>

Juggling Modules For Numpy 2.0 to 1.3 Pickle Conversion

Occasionally one has to jump through a lot of hoops and do some pretty bizzare and unorthadox things when coding. Especially when working with multiple versions of libraries. At work all of our iMacs were recently upgraded to Snow Leopard and Python 2.6 and libraries isntalled (all in 64-bit). Its nice to upgrade . . . when it doesn't break things. Unfortunately during the upgrade numpy 1.4 was installed. Now this was only unfortunate because the super computer we also need to run on has numpy 1.3 which won't unpickle objects pickled with numpy 1.4.

matplotlib, Preview, and AppleScript -- Oh, My!

 I use matplotlib fairly frequently in my research, it rocks. However, the fact that the MacOSX backed doesn't let me use 'Cmd-Q' to close things down is annoying. So my solution is a combination of pycario and preview with a little AppleScript through in for fun. I program in Eclipse with PyDev, however I run my python programs exclusively from iTerm. Hence, I'm used to cmd-tabbing back and forth between iterm and eclipse. However, when I run a program that opens up a gui, such doing "pylab.show()" things get annoying.

Pages

Subscribe to  Glimpses RSS