Category Archives: Programming

Snippets of my code from various languages and projects.

convenient file searching with Ruby, grep, and file

For my Linux kernel class, I often know that some struct exists somewhere, or remember seeing a macro defined in some file and it might be useful, but I can't remember where I saw something. I also end up trying to track down all the places a particular function is called, and don't want [...]
Posted in Programming | Tagged , | Leave a comment

representing rational numbers in Smalltalk

For my graduate-level programming languages class, I wrote this class that represents a rational number in Smalltalk. I figured I would share my source code with the interwebs for anyone else trying to learn the language. I release the code under the GNU General Public License v3. Note for students: my professor requested [...]
Posted in Programming | Tagged | Leave a comment

the pain of Facebook application development

For the past few days, I’ve been trying to create a Facebook application for interacting with Github. I hoped to spend my time mainly on the Github portion, figuring out how to post wall posts on Facebook about recent Github activity, etc. However, I’ve instead argued with the various Facebook APIs. I [...]
Posted in Programming | Tagged , , | 2 Comments | Current music Prime by Hearts By Darts

two new programming projects

I’ve gone on a programming project binge today, coding first in C# on a project to add an enforceable Implements attribute to class members, then in PHP to write a Github application for Facebook. I’m interested in co-developing the Facebook app, too, and have emailed a few of my programmer friends at UK to [...]
Also posted in Techy | Tagged , , | Leave a comment

heap sort in ML

This past semester for my programming languages class, we had to implement heap sort in Standard ML. This is my implementation, which I release under the GNU General Public License v3. I split the code into two separate files: shared.ml and heap_sort.ml, where shared.ml contains functions that might be of use with [...]
Posted in Programming | Tagged , | 1 Comment

the wily C# shuffle

My programming languages professor is quite the wily one. For our last programming assignment in there, we’re to write a fraction class in both Java and Smalltalk, as part of our coverage of object-oriented languages. I asked if I could do C# and Smalltalk, since I really like C# and, darn it, everyone [...]
Also posted in Class | Tagged , , | 2 Comments

C# and Visual Studio

Yarr, so work at HP has been good; I’m enjoying my time there. I’ve worked from home a few times, which has been nice: there’s nothing quite like coding in your pajamas and getting paid for it. I’ve mainly been writing PL/SQL queries and programming in C#. I was apprehensive about [...]
Posted in Programming | Tagged , , , | 3 Comments | Current music What Else Is There? by Röyksopp

code reports Rake task

This will run various Ruby Gems for creating code quality reports, store them in public/ in your Rails app, and create public/reports.html with links to each report. You need Saikuro, Flog, Flay, Reek, and Roodi, since this Rake task uses them all. Save this Rake task in your lib/tasks/ directory in your Rails app, and [...]
Posted in Programming | Tagged , , | 2 Comments

sortable arrays of symbols in Ruby

I got this error in my Rails app because I was trying to sort an array of symbols: undefined method `' for :my_symbol:Symbol. I defined the spaceship method for the Symbol class and included the Comparable module in order to have other comparison methods available for symbols. Ruby class Symbol   include Comparable   def <=>(other)   [...]
Posted in Programming | Tagged , | Leave a comment

C++ shell with forks and pipes

As an assignment for my operating systems class, we were to write a shell in C or C++. I'm putting my work here under the GNU General Public License v3 in hopes that it will be helpful for someone else, presumably some future student arguing with the C language, which I find infinitely frustrating to work with sometimes.
Posted in Programming | Tagged , | 7 Comments