Can I Trust Him
Nathan McWilliams
[Flash 9 is required to listen to audio.]

Another song for an RPG game I’m working on based on David’s story. This is the theme song for David and his companions’ first home base in the game, shortly after David started being chased by Saul. In that sense, it’s a bit of a “hidden village” type of theme.

It’s a bit of a sad time since David is after all being hunted down by the King, but at the same time he has some loyal friends and followers who joined him that he can depend on. Here’s some relevant quotes:

“And David stayed in strongholds in the wilderness, and remained in the mountains in the Wilderness of Ziph”

“After whom has the king of Israel come out? Whom do you pursue? A dead dog? A flea?”

As always there are a number of mistakes that I’d need to fix before putting this in the game. I need to vary the baseline piano theme just slightly a few times, and the end part with the shakuhachi is too loud.

18 plays.


New Blog

Just switched my personal site over to tumblr. My previous site served me well for over two years.

All of my sites before this were completely custom from the ground up, so using a service is new. My last site was getting dated but unfortunately I just didn’t have the time to build a new one. Even in the end, though, I spent more time than I was supposed to customizing this tumblr template. Check out the 100% CSS3 “contact” dropdown above :)

I hope to focus a little more or tech-related posts, in addition to the usual music and other creative work.


Professional Summary

This is a summary of my professional history. My linked in profile contains more information. I’ll keep this post updated with the latest info.

Currently a web developer at salesforce.com.

  • General front-end development using JavaScript, CSS and HTML
  • Writing and updating Java to support the front-end
  • JavaScript and CSS performance
  • Building out an app-wide framework for semantic and modern HTML5 markup, unobtrusive scripting, and object oriented CSS
  • Supporting the whole dev org as a general UI consultant

Before that, I was a graduate student at Carnegie Mellon University. During grad school, I interned with NextJump working on mobile development, Java + Hibernate and web services.

  • Master of Information Systems Management
  • 4.04 GPA

During undergrad, I worked as a freelance web developer building and designing complete websites for over 10 clients.

In my spare time, I code web apps and projects in ruby on rails.

Here’s a list of my skills, favorite libraries, and preferred platforms and tools:

  • HTML5, CSS3, JavaScript
  • Ruby, Rails, RSpec, Shoulda
  • Java
  • PHP, Symfony2
  • SQL, MySQL
  • SVN, Perforce
  • Textmate, Eclipse, Github, Linode
  • OS X, Ubuntu flavored Linux

My contact information can be found at the top of the page.



Hope After Despair
Nathan McWilliams
[Flash 9 is required to listen to audio.]

This is a simple song, but it’s one of my favorites.

If I remember correctly, I wrote it in a couple days over a weekend around the same time I was working on “Seek the Truth.”

I like it because it’s so simple yet still carries a lot of emotion.

16 plays.


LG 47LW5600 App Store: Disconnected From Server

I was having issues with my LG47LW5600 TV and it’s app store. After 10 seconds or so of entering the app store, I would get something like “Disconnected from Server. Try again later.” It would then exit the app store.

I was finally able to fix this by going to the toolbox under setup, and clicking on “Initial Setting”. This prety much wiped everything clean and restarted the TV as if you turned it on for the first time. Afterwards the app store was working fine!


Using Jammit with Capistrano and Bundler

Jammit is an awesome asset packaging library from DocumentCloud that I’ve been playing around with. It all works pretty seamlessly.

For deployment, I’m Capistrano, along with Bundler. In order to get Jammit to generate the asset files on a deploy, I added the following task to my deploy.rb file, inside of namespace :deploy

desc "Generate assets with Jammit"
task :generate_assets, :roles => :web, do
  run "cd #{deploy_to}/current && bundle exec jammit"
end
after "deploy:symlink", "deploy:generate_assets"

This will automatically generate the assets during a cap deploy. bundle exec is required for running executables that comes with gems.


Winding Path
Nathan McWilliams
[Flash 9 is required to listen to audio.]

From April 2009. This one was lost and forgotten, but I came across it recently.

11 plays.


Loading large SQL data files in Rails 3

So what’s the best way to load large sql data sets in rails apps?

I’ve just started learning ruby on rails, and I’m trying to port one of my existing sites to it. Part of the conversion is dumping and importing a rather large set of MySql tables. These tables contain the text for whole books. In some cases, we are talking 30,000+ records.

This made it unfeasible to use the existing conventions I’ve found so far for bulk loading, or “seeding” data into the database, because it would be too slow. I really just needed to run the SQL statements directly.

However I wanted to do this all through rails, using a rake task if possible. Rails 3 comes with a seeds.rb file under /db which lets you run arbitrary Ruby code. This is loaded when you run the task rake db:seed.

Using that, I wrote some code that will read in sql files and load them directly into the database. Here’s what I put in my seeds.rb file

base_dir = "#{RAILS_ROOT}/db/data"

bulk_load = [Book, Chapter, Verse]

bulk_load.each do |table|
  if table.first.nil? # only bulk load into empty tables
    f = File.new "#{base_dir}/#{table.table_name}.sql"

    while statements = f.gets("") do
      ActiveRecord::Base.connection.execute(statements)
    end  
  end
end

Basically, I’m creating an array of several model classes that need to load bulk data. I loop through this array, and if the model doesn’t have any records I look for an sql file with the same name as the table.

For example, the Book model will look for books.sql. The sql file itself comes directly from a MySql dump.

Now one hangup is that for my larger data sets, it was just too much to load the file into memory all at once. Fortunately the MySql dump uses multiple INSERT statements for every 350 records or so.

Using a basic regex expression, I inserted an extra newline “\n” before each INSERT statement in the sql file.

The line f.gets("") will actually read the file in chunks, separating on two newline characters (\n\n). Each chunk is then executed directly with the ActiveRecord’s execute function.

Ultimately, this lets me populate my tables with the contents of my books all from the command line using rake db:seed.

I wonder how this fits into “the Rails way”.


Politics

A two party system seems fundamentally flawed. There should be 3 dominant parties, so that no one gets overwhelming control, and no one can prevent progress over the sense of reason.


A Desolate Way
Nathan McWilliams
[Flash 9 is required to listen to audio.]

a desolate way.

the way of travel is not unknown;
you aren’t the first person to take it.

it leads to an entrancing place;
your steps won’t be the last to walk it.

yet right now you are the only one to brave it.

stripped branches and misplaced stones.
abandoned trees and uneven ground.

a tangle of uncertainty, yet constant predictability.
uneventful commotion, and unsettling serenity.

this Desolate Way is only as valuable as the destination it takes you.

10 plays.


Enchanting Snow
Nathan McWilliams
[Flash 9 is required to listen to audio.]

First new song in a long time. The recording for this one is different too. Instead of going through MIDI, this is just a direct recording of me playing.

I’ll try to describe the image I had in mind when I came up with this. Imaging standing outside in the dark of midnight, with a flurry snowflakes floating softly to the ground. The ground is covered in white, and the stars in the sky are visible. Even though its the middle of the night, the bright snow creates a luminous effect, enhanced by midnight’s soft quietness.

Just stand peacefully and take it all in. It quite enchanting.

13 plays.


Seek the Truth
Nathan McWilliams
[Flash 9 is required to listen to audio.]

I recoded this song back in October of ‘07, but I never put it up because there’s so many mistakes in the recording. I really like the ideas behind it though.

Some parts of this song date back to when I first started recording music, which I think was in May of ‘07.

“Go up and down the streets of Jerusalem, look around and consider, search through her squares. If you can find but one person who deals honestly and seeks the truth, I will forgive this city.” Jeremiah 5:1

“Be diligent to present yourself approved to God, a worker who does not need to be ashamed, rightly dividing the word of truth” 2 Tim 2:15

5 plays.


Electric Guitar

Well, I bought a little all-in-one guitar package. Came with an electric guitar, a few accessories, and even a piddly little amp. I’m taking some lessons from JamPlay as well.

It will be interesting to see how this goes. I’m not even sure what style of music I want to play. I’m trying it out because it seems like such a versatile instrument, and I really love it’s sound. In the hands of a skillful musician, I think it can fit into almost any genre of music.

I will say though, off the bat this seems much less intuitive and natural to play than the piano. The piano starts off easy, but gets hard quickly. I’m hoping the electric guitar is the opposite.


New Music

Well from the looks of things one may think new music has become a scarce commodity. On the contrary, there are a ton of half-written songs patiently waiting in my keyboard. I’m looking to record most of them, as well as re-record some existing ones on here. Maybe slightly new website redesign to go along with it!

close