HomeRamblings  ⁄  ProgrammingSQL

SQL

Making Ruby talk to MSDE

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 against the wall. I won't cover a complete Ruby and Rails/Ramaze/Sinatra installation. This post assumes you have that much down pat, so we'll pick up the ball with installing FreeTDS, unixODBC, Ruby ODBC If you're using Ubuntu 8.10, you can get away with installing everything from packages with the following: ~~~ bash apt-get install unixodbc freetds-common tdsodbc \ libodbc-ruby1.8 \ libdbi-ruby1.8 libdbd-odbc-ruby \ autoconf make ~~~ **NOTE: I wrote this article and right before publishing, attempted to replicate these results on both mac OS X and CentOS… read more


Rails vs. Ramaze Performance Comparison

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 today, I have no idea when I can truly count on Rails 3.0's arrival at the party. Thus, I have begun looking at other frameworks that are available today. ## Introducing Ramaze One I found is [Ramaze][1]. I have to say that Ramaze is a very minimalist approach to a framework that is actually rather enlightening. For one coming from a Rails' world, it can feel a bit sparse at first. But lately, I'm attributing my lack of comfort to being put on my toes to… read more


Ruby, Mysql, CentOS 5, and 64-bit

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 little to no 32-bit libraries installed.  There's been a few sticky points to push through and one of them is getting Mysql and the appropriate mysql gems installed.  This quick post shows the way. ## My System I am running CentOS 5.2 64-bit. Or more succinctly: ~~~ text 2.6.18-92.1.22.el5 #1 SMP Tue Dec 16 11:57:43 EST 2008 x86_64 x86_64 x86_64 GNU/Linux ~~~ ## The Problem If you simply execute: ~~~ bash sudo gem install mysql ~~~ You'll get the following errors on a 64-bit system:… read more


Converting Oddmuse Wiki to Edgewall Trac

Our company began long ago with wiki's, but we chose the Oddmuse wiki way back when. These days, we're heavy users of Trac wiki because of its integrated ticket support system. So what to do with all those old wiki's that folks have stopped using and reading. The Oddmuse wikis still hold valuable data, but they have since become an administrative overhead to keep around, so I decided to convert them all to Edgewall's Trac. To get started, I needed to know how to get the data into Trac. The following links gave me an API I could utilize to create trac pages and content: * [Trac Data Models][1] * [The Data model Python code][2] Great! Except there's one small problem. I don't really know python all that well, even though I did do a bit of Zope development, oh,… read more


Geocoded Zipcodes

You would think that loading up a database of zip codes would be an extremely simple case of finding a public database on www.usps.gov, and then loading up with a database bulk load. It turns out that, while the USPS does offer products for you to purchase, and a rather nice lookup interface for looking up zip codes and so on, there's not really any free data to be had that I could tell. So the hunt was on to find some zip code data, preferably geocoded (latitude/longitude for GIS) zip codes and then load them into MySQL. A bit of hunting around turned up [this list of zip code databases][1]. The first link to CivicSpace database appears to be defunct (I got a Go Daddy "this page is parked" page). So, the next free one, offered by [Popular Data][2]… read more


DRYing your Views

Let me start out by saying that I am finally beginning to understand a bit about that magical Ruby block notion and how implementing methods through block passing can really empower you as a Ruby developer. Thanks to, a most excellent [Ruby tutorial][1], I am definitely feeling a good bit more empowered about getting my Views in Rails all DRY'd up. The problem: I wanted to introduce a property editor metaphor for the website I'm working on where properties could expose edit forms for just about any situation, much like wordpress' widget interface does. That is, there's an area of the current page that shows basic information about the property in a read-only (and preferably compact) form, and user could click an "edit" button and exposed an editable version of the properties. The "edit" link becomes a "cancel" link, which,… read more