A single press for all my words 

Filed under: Blogroll on Thursday, December 27th, 2007 by jeremy | Comments Off

So one of the big changes I made on my new slice is to centralize my WordPress blogs. I run three WordPress sites, and having to upload a whole new codebase three times while being careful not to overwrite my customizations, plugins, themes, etc. was beginning to grate. It would be better to have one unit of code that I could maintain and tweak. But was that possible without going down the MU route?

The answer is that not only is it possible, but it’s also rather easy. I made a modification to my wp-config.php file that appends a host name prefix to every WP table in the database. So I run everything in one database, and the wordpress PHP code just chooses the tables to run off of based on the requested host. Pretty slick, because it also means I can keep all my themes, plugins, etc. in one place and just turn them on and off in the different tables. And I’m using Subversion to run updates, which means it doesn’t overwrite files I’ve modified, while still letting me do updates with one command.

So I guess now that I’ve found such a convenient solution to my problem, I’m wondering if it’s vulnerable at all how vulnerable it is. I suppose I’m advertising any security holes, but I’m a pretty transparent internet user, and all the data’s backed up anyway - plus, I keep a pretty good eye on the server, and it’s locked up rather tight for anything that would be terribly damaging. But all you WordPress gurus: what do I need to know about this approach? Is it insecure? Are there performance issues with which I need to concern myself? This is running everything from my personal blog to a moderate traffic aggregator. I’d appreciate any insight or warnings or sharp tongue lashings you could provide.

And of course, this is only the first step. I still want to do a full reengineering of my stylesheet and clean up loose ends in the design. And I’m gonna implement some long-overdue social networking upgrades… you’ll see. So stay tuned for more wordpress-y goodness.

Ruby 1.9 released! 

Filed under: Blogroll on Thursday, December 27th, 2007 by jeremy | Comments Off

ruby.pngPraise be to jeebus - a development release of Ruby 1.9.0 was announced on ruby-lang.org Christmas Day (nice timing for the western world). I guess it’s too early to install on my new slice, and probably better to wait for the package anyway. Nevertheless, at RubyConf this year we got a sneak peak at the priorities and decisions that have been guiding the implementation of 1.9, which above all should be much faster than 1.8 (and more competitive with other languages). More detailed changes here.

Also, in case you didn’t hear, Rails 2.0 was released last month. ‘Tis hot. And I finally figured out that scaffolding has NOT been gutted; I had lamented the fact that the scaffolded views no longer generated HTML input fields based on the database table fields. But now it’s much more consistent: you name the fields at generation time and it creates the views and the migration for you. Kids, it pays to read the docs.

Welcome to my new slice 

Filed under: Blogroll on Thursday, December 27th, 2007 by jeremy | Comments Off

Since I’ve been on SliceHost I’ve learned a lot about server management. I’ve also made a lot of mistakes and generally made a mess out of that slice. So I got a new one and am moving everything over. This is the first post from the new slice. If you have performance issues, let me know - I probably could stand to tweak some of the Apache and PHP settings.

2nd Annual McWeiland Chili Cookoff Photo Montage 

Filed under: Blogroll on Monday, November 5th, 2007 by jeremy | Comments Off
And first YouTube upload ever. Tasha did the video on her new MacBook - like that “Ken Burns” effect? Enjoy!

Today is November 5th! 

Filed under: Blogroll on Monday, November 5th, 2007 by jeremy | Comments Off

Remember to contribute as much as you can - especially today - to Ron Paul! Both Tasha and I just submitted our donations.

2nd Annual McWeiland Chili Cookoff Photo Montage 

Filed under: Blogroll on Monday, November 5th, 2007 by jeremy | Comments Off

And first YouTube upload ever. Tasha did the video on her new MacBook - like that “Ken Burns” effect? Enjoy!

RubyConf ‘07 

Filed under: Blogroll on Sunday, November 4th, 2007 by jeremy | Comments Off

I'm in the final hours of my first RubyConf, the annual international conference for rubyists being held in Charlotte, NC this weekend. There's been way too much information for me to possibly absorb completely, but the exposure to the community, the attitudes and thinking, and the possibilities people are exploring has certainly been a wonderful phenomenon to experience. 'm also seeing that I really haven't even scratched the surface of ruby - there's much more for me to learn than I suspected in my most pessimistic estimates.

Conference highlights (from memory) are as follows:

  • Jim Weirich's talk on Advanced Ruby Class Design. I was struck by his focus on the problem rubyist's essential dillemna / task of thinking outside the box when approaching a problem. Using rake and other examples, he showed how Ruby makes possible ways of coding that make the old, standard Java-esque OO approaches obsolete and unnecessarily one-dimensional. This is something I constantly struggle with, because I get used to solving a class of problems in one way instead of looking at each unique problem as an opportunity for a creative and expressive Ruby solution. I need more experience with a variety of Ruby projects: I learned more about Ruby by doing a scripting program over a week or two for a buddy than I have in 1.5 years of Rails coding.

  • Ben Bleything on Controlling Electronics Using Ruby was damn cool. This is an area I've been trying to get into for a while. I've wanted to do a custom security setup tied to my home computer ever since I did it professionally at NetTalon. I really feel like Ruby could make it fun, but I dunno - I'm easily frustrated and electronics seems frustrating. But it's awesome to see support out there for rubyist electronics hobbyists.

  • Evan Phoenix on Rubinius, a new virtual machine for Ruby, was cool. He seemed to focus on the challenge of implementing as much of the language source in Ruby, which strikes me as the perfect OO approach. It's very exciting.

  • Luke Kanies on Essential Incompleteness in Program Modeling was my favorite presentation. Where Weirich talked about the need to approach problems differently, Kanies introduced one way to find new approaches: look at solutions to similar problems in science and math. He invoked examples from biochemistry, physics, and fractal geometry to help demonstrate a way to constrain the scope of research into solutions, make good use of your effort and energy, and more - I need to watch the presentation again (or another two times) and read the books he suggested. It promises to be a key to real strides in my programming style.

  • Laurent Sansonetti is an Apple OS X engineer who gave a presentation entitled Mac OS X Loves Ruby. He demonstrated Leopard's unprecedented support for Ruby. Highlights were DTrace (you can read more about that elsewhere) and RubyCocoa, a bridge between Ruby and Cocoa that looks insanely powerful when combined with Interface Builder. I'm not an Apple fan boy in the least, but as a Mac user this stuff was definitely cool. It's nice, I guess, to see rubyists' loyalty to Apple reciprocated in some way.

  • Matz's keynote was awesome. I have a problem with accents, but what I could understand was really enjoyable. Matz is funny and demonstrates a humility and good-natured approach to coding from which I think every community could stand to learn. I love that somebody who isn't crazy about the enterprisey destination that Ruby is heading towards who doesn't have to get all dogmatic and "opinionated" about it. He stressed attitude as the advantage of Ruby - rubyists like the way Ruby allows them to code, even if it isn't always the ideal tool for the job. People matter.

  • Ben Scofield gave a talk called Cleanliness is Next to Domain Specificity that tied in concepts from linguistics to DSLs and domain modeling. He offers tips on finding good ways to represent your domain and build upon your domain knowledge through the language. Very cool and entertaining.

I had a great time hanging with all my new and old friends. Props to the #rubycodejam / CVREG peeps (Jamie, Mel, Jim, Anoop, Jon), my new co-workers at Intridea (Chris, Pradeep, Michael), my old friends (Ryan, Patrick, Ben, and others from Viget Labs) and new friends (Andrew, Jay, Brian, and sorry if I can't remember you - I'm on little sleep). I did a lot of drinking, not much sleeping, and a lot of participating in great conversations. And I'm excited about a CVREG collaboration with the DCRUG as well as getting cracking on Bookmarker with Mel.

Summary: CVREG.success? #=> true

Web Development – The Next Generation 

Filed under: Blogroll on Monday, October 22nd, 2007 by jeremy | Comments Off

Over at the Central Virginia Ruby Enthusiasts Group (cvreg.org) blog I recently contributed an article reflecting on my talk to a local high school web design class. Since the overwhelming topic was money and jobs, not the art of programming and design, I had a chance to impart some of my observations of the industry to them. Here’s an excerpt:

Get used to learning constantly. Things move way too fast in this industry for you to learn one language and have that make your career. It’s better to challenge yourself by engaging in a wide variety of technologies to hone your general programming, debugging, testing, and other skills. Try out new languages, read blogs, go to conferences, and do your own experimental projects to challenge yourself. Be the guy that can solve any problem with the right tool, rather than “the Java guy” or even “the Ruby guy”.

Selenium_on_rails Quick Start 

Filed under: Blogroll on Monday, October 8th, 2007 by jeremy | Comments Off

Over the past few days I’ve been diving into Selenium, a automated functional testing tool for web apps. It’s pretty slick - in fact, like most of the technologies I’ve been using over the past two years, it does so much for you that the obstacle always ends up being a matter of getting out of its way and letting it do its thing. So I’m gonna throw out some pointers on using Selenium within the Rails testing framework via selenium_on_rails plugin; the only caveat I’ll mention is that this post is especially geared towards the newbie wading into a project with pre-existing selenium tests. So I’m focusing on how you can get started with writing tests and integrating them into what’s already there.

Open up firefox and install the Selenium IDE extension. This allows you to record your test by simply using the browser. The IDE keeps track of where you click - just make sure the record button is on. Go ahead and click through your test application and watch as the IDE records your actions.

Now you need to go into your selenium_on_rails plugin area and edit config.yml. In the browser config area, make sure it’s pointing to your browser binary. For example, I kept most of the defaults, but made sure the following lines were there, uncommented:
environments:
  - test
browsers:
  firefox: '/Applications/Firefox.app/Contents/MacOS/firefox-bin'

Next, especially if this is a project with existing tests, make sure you’ve installed the right user extensions. These are prefabbed actions for doing things like logging in via javascript. In my project I found this file in

vendor/plugins/selenium_on_rails/selenium_core/scripts/user_extensions.js

All you need to do is point the IDE at this file by opening the IDE window and navigating in the top menu to “Options > Options > General tab”. Put the path to user_extensions.js in the input box entitled “Selenium Core extensions (user-extensions.js)”.

OK, so let’s take a look at the existing selenium tests. They’re probably in test/selenium. If there’s subdirectories under that, these are probably test “suites”. For example, in the project I’m working on, they’re organized depending on which type of user the test is geared towards: user or admin. The actual test scripts can be recorded in a variety of formats; mine are all HTML tables, where each row is a step in the process.

So let’s get to recording tests. First, start your server in the test environment:

mongrel_rails start -e test

The key to testing is executing an action and verifying the response. In Selenium, this is accomplished via assertion statements. The IDE makes this elementary: when you’ve reached a page on which you need to verify the output, just highlight the text and right click. At the bottom of the popup menu, several approaches to verifying the text are mentioned. I don’t understand all the “selenese” yet but there’s simple commands like “assertText” that ensure a particular passage is included on the page - that should get you started.

So you’ve recorded the steps necessary - now click “File > Export Test As” and save it in the correct test directory. Now you should be able to run this test via rake test:all. That’s it! I’ll try to keep

Back to work! 

Filed under: Blogroll on Thursday, October 4th, 2007 by jeremy | Comments Off
Well, I’ve put the update on my life off for far too long, time to come clean. As of Tuesday I am working for a D.C.-based web development firm that is focusing on Ruby and Rails. I get to work from home in Richmond and the work I’m doing is some pretty cutting edge stuff - rspec, behavior driven development, acts_as_solr, mocha - hotness. I’m very happy with the situation. I should also mention that Tasha doubled what was till then her all time sales record at the Crafty Bastard show in D.C. It worked out well for me to go up with her because (a) she needed the help - at one time she had a line going out her booth of young, hip people buying her stuff - and (b) I got to have coffee with my present boss. Plus I had ethiopian food for breakfast - and it was delicious! Not only that, I also found out that the guys who led the political action committee project I just came off of are interested in doing some for-profit things with the codebase. The cool thing is that I’m already a partner without even having to work on the code ever again! Also, the 2nd Annual McWeiland Chili Cookoff will be held October 20th. Invites are going out soon, but if you didn’t attend last year and want to, let me know. Finally, I have to say that I just stumbled on essembly.com today, and if you’re interested in a decent politically-oriented online community, check it out. I’m hooked - I’ve had some of the best political conversations in years on there (not a high bar to clear, you understand).