My Ruby & Rails Reading List
February 25th, 2010By: Steven Haddox
No Comments »
FYI: I tried to list these in order of preference / desire.
Books I already own
Ruby:
- Programming Ruby 1.9 (the “pickaxe” book)
- The RSpec Book (beta)
- The Ruby Way (2nd ed.)
- The Well Grounded Rubyist
- Why’s Poignant Guide to Ruby || (online / free PDF)
- Ruby Best Practices || (slowly releasing free online)
- Enterprise Recipes with Ruby and Rails
- Textmate (I’m a big Mac fan)
Rails:
- Agile Web Development with Rails (2nd ed. - get the 3rd ed. in my wishlist)
- The Rails Way
- Advanced Rails Recipes
- Flex on Rails
- RailsSpace (online via Safari)
My “Wishlist”
Ruby:
- Design Patterns in Ruby
- Best of Ruby Quiz
- Mr. Neighborly’s Humble Little Ruby Book || (online / free PDF)
- Scripted GUI Testing with Ruby
- Everyday Scripting with Ruby
Rails:
Rails and large data strings in MySQL (longtext)
June 6th, 2009By: Steven Haddox
2 Comments »
During my day-job this week I came across a situation where we had nice functioning code very near to our launch of a Rails application. We had just completed migrating over some historical data from another database (have I mentioned how much I love rake in the past, if not I may have to do a blog post about that too). Anyway, the data all migrated over in a matter of minutes and after invoking a few more custom rake tasks that were simple to write we had every record in the exact same position as it was originally.
The cozy aura of accomplishment had settled upon our little team when we soon discovered that all was not well in Rails-land. You see, we are processing data at defined intervals (on a per-record basis by an attribute on the object). We have a cron job setup to invoke a rake task that checks and sees if each record needs to be updated or not (I love .minutes.ago and built-in timestamp fields btw). Then the rake task fires off the method call to update with the new data as often as needed. After the update is complete we parse the new data and create a JSON string that is stored in the database (for performance over parsing every time we want to display it). We also do a combination of all the past data sets we’ve received (one for 24 and 72 hours each) and store those in JSON format to the database as well. This worked out great on all our sample instances where our objects didn’t have hundreds of data sets being merged and combined into one long JSON string.
However, once we get some live data our application started blowing up rather quickly. We came across an ‘rbuff’ error (or something weird and very vague in its meaning) and spent a little bit of time realizing that the string we were trying to write to the database was more than 64KB. We had set our fields to ‘text’ and it was truncating our data (and hence blowing up all our JSON.parse methods to get our strings back into Ruby hashes). The fix seemed fairly easy, we just had to change our column types from ‘text’ to ‘longtext’.
If you do a Google search you’ll find several ways to have MySQL create a column in the table with a longtext type in Rails. However, none of them worked for me (we tried :text, :limit => huge_number as well as :text, :limit => 64K+1, and several other methods we found online). I couldn’t find any documentation to indicate that Rails had added in support for :longtext as an actual column type as it seems to be MySQL specific. My pair suggested (for the 10th time) that we just put :longtext in our migration file instead of :text and see if it worked. I’m not as much of an off-the-cuff kind of guy as he is and I was skeptical it would work as so many blogs said to do it the ways we had been trying. Well I finally gave in and said, “Okay, well try it your way, but I bet you’re wrong.” We edited the migration to:
change_column :table, :column_name, :longtext
rake db:migrate and all of the sudden our MySQL table was showing a column type of ‘longtext’ as we had wanted all along. Needless to say I was rather embarrassed that this wasn’t better documented and I lost the bet to my pair. My question now is, does anyone know if :longtext as a column type is supported on other database types or is tied directly to MySQL with Rails? I can’t seem to find any documentation for this as a column type anywhere so I’m not sure if it is new to Rails 2.3.2 or if it just has been overlooked in the docs. As the searches I performed hadn’t brought anything back of any use for migrating my column to longtext I figured I should try and make sure I at least get a blog up about it to help anyone else who may be in a similar situation.
Enduring To The End
September 15th, 2008By: Steven Haddox
No Comments »
It’s not often that I get to take the things that I absolutely love the most in the world and combine them with things that I absolutely hate the most in the world. Usually when those two things happen it is related to Microsoft Windows in some form and it absolutely kills me for several days. Well not this time, this time it pertains to a very positive turning point in my life I believe. I have recently acquired a Wii Fit as well as a Nike+ iPod kit. These two small sets of hardware have enabled me to combine something I love with something I used to hate and hopefully improve my life and have fun while doing it.
I must admit that there are several factors involved in my decision to start getting more healthy. I decided to cut the majority of soda out of my life after my incident several months ago where I had 4 kidney stones and some major medical issues that were not very pleasant to go through. But in addition to cutting out soda there needs to be more. Something more substantial that will make it so I’m not having a heart attack before Paisley has even graduated high school. So here is the list of things that has helped change my motivation for working out and getting healthy: Read the rest of this entry »
Why I Stood in Line for an iPhone 3G Today
July 11th, 2008By: Steven Haddox
2 Comments »
I just posted the following as a comment on a blog as to why I already purchased the iPhone 3G. I thought it might be appropriate to share on my blog as well. Enjoy.
I’ll try to keep this short and simple, but don’t be surprised if you get a short novel. I am a little offended that the beginning of this post [original blog linked above] begins with such bias as to say that if Steve Jobs branded a sandwich with the Apple logo a line would form to buy it. Give most Apple “fanboys” a little more credit than that.
I personally have an Apple logo tattoo (for the letter A in my wife’s name as she converted me to Apple). I also have a Burton tattoo on my foot. Why are both of my tattoos commercial companies? Read the rest of this entry »
Apparently Shameless Self Promotion Works (statistically speaking)
April 29th, 2008By: Steven Haddox
No Comments »
For those of you who may have somehow not know, I was told I was being let go last week, so I’ve obviously been putting my resume out as much as possible since my last day of “vacation” from my current job runs out tomorrow as far as I know (nobody has bothered to e-mail me back as to how many actual hours I had or how many hours I was paid for last week…. talk about a failure of communication even after multiple e-mail requests). That’s a long story for another time though (I’m sure I’ll blog more about my job loss AFTER I have secured a new job…heh).
Anyway, I’ve probably submitted my resume to about 12+ jobs on Dice & Monster in the area that seem like decent to really good fits, but I’ve found that there’s even better opportunities and more relevant positions actually available on craigslist.org. I’d estimate that I’ve sent my resume to more than Read the rest of this entry »









![[del.icio.us]](http://stevenhaddox.com/wp-content/plugins/bookmarkify/delicious.png)
![[Digg]](http://stevenhaddox.com/wp-content/plugins/bookmarkify/digg.png)
![[Facebook]](http://stevenhaddox.com/wp-content/plugins/bookmarkify/facebook.png)
![[Google]](http://stevenhaddox.com/wp-content/plugins/bookmarkify/google.png)
![[MySpace]](http://stevenhaddox.com/wp-content/plugins/bookmarkify/myspace.png)
![[Newsvine]](http://stevenhaddox.com/wp-content/plugins/bookmarkify/newsvine.png)
![[Slashdot]](http://stevenhaddox.com/wp-content/plugins/bookmarkify/slashdot.png)
![[StumbleUpon]](http://stevenhaddox.com/wp-content/plugins/bookmarkify/stumbleupon.png)
![[Email]](http://stevenhaddox.com/wp-content/plugins/bookmarkify/email.png)


