Programming

General topics of interest to software development.

Getting Ruby to talk to MSDE

Posted by Michael on April 9, 2010 in Configuration, General, Ruby Language, SQL, Setups

Getting Ruby to talk to Microsoft SQL Server 2005 is one thing. Getting Ruby to talk to Microsoft SQL Server Developer Edition 2000, has one twist that threw me off for hours. Here, I’ll show you how to do and hopefully save you lots of frustration and brain damage from banging your head [...]

Implementing Ruby jobs in the background

Posted by Michael on November 6, 2009 in Programming, Ruby Language

I needed a way to kick off a background job that was triggered by an end-user on my Ramaze-backed website and could run for almost two hours! This article brings together all the elements to get the job done.
Preamble (a.k.a. Ramblings)
I can hear you exclaiming, “Two hours!? Are you nuts? You really [...]

What makes a top award candidate, anyhow?

Posted by Michael on August 1, 2009 in General, Ruby Language

In our local Linux user group mailing list, one of the participant asked the group for recommendations for open source software projects that should be considered for a prominent publication’s top 100 awards. The ensuing discussion got me to wondering: What is the purpose behind doing the awards? Most of what I [...]

One ActiveRecord Model Acting as a List and Tree

Posted by Michael on April 30, 2009 in Programming, Ruby Language

Occasionally, Rails can appear to make your life extremely easy while silently throwing you a curve-ball. I needed a model that required a hierarchy while also preserving order of the records. Although fairly straightforward to set up and start immediately using, there are a couple of “gotchas” to watch out for and this [...]

Rails vs. Ramaze Performance Comparison

Posted by Michael on February 19, 2009 in General, SQL, Servers, Systems

One of my biggest concerns of late is that my “more than just a little trivial” Rails projects seem to find their way straight into the heavyweight category in no time at all. While I am quite hopeful that Merb being the 3.0 version of Rails will resolve many of the issues I face [...]

Ultraviolet gives new life to Syntax highlighting

Posted by Michael on February 5, 2009 in General, Programming

I am tired of Google’s Syntax highlighter.  If I accidentally switch to Visual mode in the editor and do some edits and switch back to HTML mode, then I lose the class=”code” moniker and I have to go through the entire post and fix.
Another drawback I have with Google Syntax highlighter is that the page [...]

Ramaze and ActiveRecord

Posted by Michael on February 4, 2009 in General, Programming, Ruby Language

Thanks to the great folks on IRC over at Freenode#ramaze, I was able to not only get Ramaze working with Erubis and Activerecord for a pseudo apples to apples comparison of Rails vs. Ramaze performance benching, but I was also able to get Apache 2.2.9 talking to Passenger to Ramaze. This quick post will [...]

Initial release of Elemental

Posted by Michael on February 3, 2009 in Programming, Ruby Language

I am happy to announce the initial release of Elemental 0.1.1.
Elemental provides enumerated collection of elements that allow you to associate ruby symbols to arbitrary “display” values, thus allowing your code to think symbolically and unambiguously while giving you the means to easily display what end-users need to see. Additionally, symbols are associated with ordinal [...]

Ruby, Mysql, CentOS 5, and 64-bit

Posted by Michael on January 19, 2009 in SQL, Systems

I have lately switched away from Ubuntu as my desktop and started using CentOS 5.2 because I wanted better support for a lot of RAM and virtualization (where I can quickly commission Linux servers to build out my testbed of target environments).  With the change, I also make the leap into pure 64-bit libraries with [...]

Rails has and belongs to many (habtm) demystified

Posted by Michael on October 27, 2008 in CSS, Programming, Ruby Language

Every time I have to implement a many-to-many relationship between Rails models, I seem to have to figure out how to do it effectively all over again. Especially as Rails seems to evolve the relational hooks with better support and elegance. Here, I will show a has_and_belongs_to_many strategy that works well for me. Along the way, I’ll expose a few other minor tricks, such as adding a custom inflector for pluralizing your model or not adding the ID column on a table declaration.