Warning: mktime() [function.mktime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 24

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 30

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 32

Warning: mktime() [function.mktime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 24

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 30

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 32

Code Snippets


Warning: mktime() [function.mktime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 24

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 30

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 32
March 6th, 2009

I’ll post some code snippets here that I like.


Warning: mktime() [function.mktime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 24

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 30

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 32

Warning: mktime() [function.mktime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 24

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 30

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 32

Non-rails solution worked better for me


Warning: mktime() [function.mktime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 24

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 30

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 32
January 11th, 2009

Like most of my projects I take it to 90% complete, and having myself that it is possible and cool, I then move on to something else. So it is thus with this project. Work and other things have distracted me, and I haven’t yet completed it, though I’m most of the way there. If I get it just a bit more professional looking I’ll actually provide a link, but first I have to polish it and also get some permission’s out of the way as I’m leveraging other people’s work (which is also why I’ve been a bit vague on the details).


Warning: mktime() [function.mktime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 24

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 30

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 32

Warning: mktime() [function.mktime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 24

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 30

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 32

Update


Warning: mktime() [function.mktime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 24

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 30

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 32
October 6th, 2008

Well, I actually got the model completed in Rails and had the right data relationships, etc.  But I just couldn’t stomach the fact that the underlying relational database was forcing data relations (and work) overhead.  So I hit pause on that effort and went back to working with the all ruby data structure.  That has progressed quite a bit, but I’m pressed for time, so the details will have to be for later.


Warning: mktime() [function.mktime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 24

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 30

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 32

Warning: mktime() [function.mktime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 24

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 30

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 32

Blech = Rails :: Database integration()


Warning: mktime() [function.mktime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 24

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 30

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 32
September 16th, 2008

Well, I’ve given up on putting my data in a database underneath Rails for now.  It was forcing me into keeping my data structured in an entirely different way then I currently had it.  My ruby project’s data was built upon OOP principles.  Using quite a bit of inheritance to leverage commonality.  Anyway, Rails kinda supports modeling data this way, but it doesn’t support the actual underlying data in that way, at least the version I’m constrained to (1.1.6).  To be fair, I’m still leveraging the Rails Controllers and Views, but I’ve found that the hill gets steeper the more you violate convention.  Some Rails helper functions aren’t working for me (but it may be due to my Rails version).

Regardless, I have made a lot of progress.  I have an email listener that can now dispatch requests to activate my project, I have my user objects generically accessible.  All executable and accessible (in theory) on my web platform.  It still is quite a ways from any kind of release (even pre-alpha), but its getting there, slowly but surely.


Warning: mktime() [function.mktime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 24

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 30

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 32

Warning: mktime() [function.mktime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 24

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 30

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 32

Ruby on Rails Step 0.6-0.99


Warning: mktime() [function.mktime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 24

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 30

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 32
September 10th, 2008

Ok, with some help from the 4-day tutorial, and the excellent help from the Ruby on Rails many-to-many tutorial and Jumbabox, I got past several conceptual hurdles.  Stumbled and figured out various version differences, began to *really* understand the basics of the Model-View-Controller model, and finally (finally!) got my proto-proto-directory working.  I can now begin expanding the system I have to solve my *application* problems, rather than futzing with the framework so much.  I will still have a lot of learnings on rails, but now I can at least make progress on *my* project vs the learning curve.  So next steps are to work towards getting the data I have into the new structure and models.  Next, is to get my application to work through the new models.  Third is to work out and improve the user interfaces to allow users to gain access to the application.  Fourth is to improve upon the directory application so that it can grow and expand elegantly.  Fifth … who knows.  Of course reality will follow a different path than my plan, but I will deal with that as it comes.


Warning: mktime() [function.mktime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 24

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 30

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 32

Warning: mktime() [function.mktime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 24

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 30

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 32

Ruby on Rails - Step 0.9 - 0.4 = 0.5


Warning: mktime() [function.mktime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 24

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 30

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 32
September 10th, 2008

Ruby on Rails is working, that’s the good news. The bad news is I’m still trying to sort through structural issues, and rails operational behavior. On the structural front, I had decided on a many-many relationship between my two main tables, with a simple join table between them and using the rails “has_many_belongs_to_many” to associate the tables through rails. However, I’m ditching this and going with the more confusing “has many :through” approach. Two reasons, the primary reason is even though initially I thought that there was not any initial need for information to be kept that was relevant to the join, I realized that this was not the case. A field I had in one of the table was really related to the join, not the table at hand. It could have worked the way I initially had it, and I would have barreled on if not for the second reason, which is that there seems to be many more examples of the latter case on the web, than the more straightforward “hmabtm” approach.

So I’m taking a slight step back and am going to work through “Four Days on Rails” tutorial. Even though the table structure doesn’t exactly match mine, it is fairly close. Plus it seems to be a complete soups to nuts tutorial. So I’m off to do that, and hopefully I’ll be back on track with my project soon.


Warning: mktime() [function.mktime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 24

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 30

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 32

Warning: mktime() [function.mktime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 24

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 30

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 32

Ruby on Rails - Step 0.9


Warning: mktime() [function.mktime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 24

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 30

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 32
September 9th, 2008

Ok, I have got Rails and MySQL talking now. Thanks to some help from Carl a support guy at phpwebhosting. Below is a snippet of the support ticket:

[Updated: September 9, 2008, 10:19 am by Support]

Hi,

I’m pretty new to rails/ruby, but do you need to specify the location of the UNIX socket somewhere? I know you can you the database config for a rails app, but not sure where if you are just using activerecord standalone. The location is-

/var/lib/mysql/mysql.sock

Best Regards,

carl


[Updated: September 9, 2008, 11:02 am by dmarti21 at 66.92.144.112]

I put that into the database configuration file and things seem to work.
Thanks!

For posterity, in the file: /path-to-rails-projects/AddressBook/config/database.yaml

In the development database section, I added the line “socket: /var/lib/mysql/mysql.sock” after the password: line, so that section looked like this:

adapter: mysql
database: AddressBook
username: myusername
password:
socket: /var/lib/mysql/mysql.sock

and was able to get the Rails page returned to me as expected.


Warning: mktime() [function.mktime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 24

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 30

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 32

Warning: mktime() [function.mktime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 24

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 30

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 32

Ruby on Rails - Step 0.1


Warning: mktime() [function.mktime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 24

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 30

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 32
September 9th, 2008

They say the first step is the hardest, and that’s proving to be true. The ruby environment works as expected, the mysql environment works as expected. So I brought them together, thinking they’d make a great couple, and here they won’t even talk to each other. It seems the pre-packaged ruby/mysql gem doesn’t like mysql 5+ or something. Rather than go into it all over again, I’ll just paste my support ticket below …. and I HATE having to ask for support. I think its a guy thing, you know, like having to ask for directions. In fact guys are probably the sole reason GPS is where its at today … oh, that’s a rant for another day … back to the problem at hand. The support request:

Subject: Rails Help - Rails not querying MySQL tablesCurrent Ticket Progress:[Created: September 8, 2008, 11:27 pm by dmarti21 at 68.98.143.121]

Hi, I was trying to get rails working, and was following this tutorial: http://www-128.ibm.com/developerworks/linux/library/l-rubyrails/
However I\’m having problems getting Ruby on Rails to connect to MySQL.
Things are ok until I try to build the model and scaffold for contact (for the contacts table). WebBrick returns this when I try to access www.younghawk.org:3000/contact
ActiveRecord::StatementInvalid in ContactController#index
Mysql::Error: Lost connection to MySQL server during query: SHOW FIELDS FROM contacts

I\’ve traced it to ruby/mysql (part of active_record). As shown in the test code and output at the end of this email. Connecting to the database works ok, but any attempt at reading it fails.

Google searches seem to indicate that there is an incompatibility between MYSQL 5.* and Rails using ruby/mysql. The advice seems generally to favor upgrading to the \”native\” mysql adapter. But that advice is coming from people that are not hosting shared environments. An alternate approach may just be recreating the mysql user, buts I couldn\’t tell under what conditions that approach worked. Below is the relevant excerpts from Ruby on Rails wiki.
Anyway, hopefully you guys can help get me up and running on rails through one of the suggestions here, or some of your own magic.

———————————————–
(http://wiki.rubyonrails.org/rails/pages/MySQL)

“The MySQL adapter will work with both Ruby/MySQL, which is a Ruby-based MySQL adapter that comes bundled with Active Record, and with the faster C-based MySQL/Ruby adapter”

MySQL Adapters
* For the Ruby/MySQL connector (also known as the “Pure Ruby MySQL adapter”) please see: http://raa.ruby-lang.org/project/ruby-mysql/

The pure Ruby MySQL adapter doesn’t work with MySQL 4.1 or 5.x

* For the MySQL/Ruby connector (also known as the “Native MySQL adapter” or “C MySQL adapter”) please see http://raa.ruby-lang.org/project/mysql-ruby/
[…]
Note: If you are connecting to a MySQL 4.1 or 5.x database, you will need to use the C MySQL adapter.
Troubleshooting
“ActiveRecord::StatementInvalid (Mysql::Error: Lost connection to MySQL server during query:)” Error

In Rails 1.0’s version of the pure Ruby adapter, this problem occurs for users created in certain way. It could be solved by recreating users using the “CREATE USER” sql syntax. This problem didn’t exist in 0.13.1 and it surprises you as soon as you upgrade to 1.0. Many topics like the one below suggest changing the driver to Native Mysql one, but try this user recreation first.
—————————————————————

————————————–
Code that seems to isolate the problem:
————————————–
require \”/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/vendor/mysql.rb\”

my = Mysql::new(\”localhost\”, \”dmarti21\”, \”\”, \”AddressBook\”)
puts my.host_info #works
puts my.server_info #works
puts my.info #works
puts my.ping #doesn\’t work
res = my.query(\”select * from contacts\”) #doesn\’t work
res.each do |row| #doesn\’t work (since above doesn\’t work)
col1 = row[0]
col2 = row[1]
puts col1.inspect
puts col2.inspect
end

(running the above results in this output)=>
Localhost via UNIX socket
5.0.37-standard
nil
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/vendor/mysql.rb:1092:in `read\’: Lost connection to MySQL server during query (Mysql::Error)
from /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/vendor/mysql.rb:499:in `read\’
from /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/vendor/mysql.rb:492:in `command\’
from /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/vendor/mysql.rb:239:in `dump_debug_info\’
from ./mysql_test.rb:6

On the positive side, as that gets sorted out, I have more time to contemplate my project’s organization, and I found a couple places where I can improve on the data model.

UPDATE!! - Adding a “socket:/path to mysql.sock/mysql.sock” to the database.yaml file fixed this (I also have a separate post on this).


Warning: mktime() [function.mktime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 24

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 30

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 32

Warning: mktime() [function.mktime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 24

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 30

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 32

Ruby on Rails Projects - Step 0


Warning: mktime() [function.mktime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 24

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 30

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 32
September 8th, 2008

Ok, I’ve been programming in ruby for over a year and am generally quite impressed with the language.  I come from an entirely different programming background than most, I think.  I am a systems architect and I tend to think forest rather than trees.  Add on to that my style of programming born from writing throw-away scripts with the mantra “just get it to work once”, and you see that I’m dangerous to let loose in the wild with access to  computing resources. Ruby has been good to me, it’s sweet syntax, and easily understood object behavior (such as duck typing, where if it walks, and talks like a daffy, then its probably ok to treat it as a daffy), and easy to read code has made me (yes me!) to easily go from concepts to implemented (albeit ugly) code without losing all my hair to language idiosyncracies.  Anyway, I had an idea for a project, and I have a rudimentary implementation in ruby already, but it would be great if this project was generally accessible, like from my website!.  So that got me thinking about rails …
I’ve read through a few Ruby on Rails tutorials, and even completed a “Hello World” rails example.  What has become clear is that the first step of a Ruby on Rails project is to have a clear idea of the data relationships.  This is a bit contrary to my programming ways … where I just dive in and code until it sorta looks ok, so I’m still getting used to it.  Anyway, the lesson learned for step 0:

Think about your project first.

Presumably the whole point is for web users to be able to CRUD (Create, Read, Update, Delete) information provided by you.  So what is this information, and how is it to be manipulated.  Thinking through that will pay huge dividends.  At least that’s the theory, and that’s where I’m at now.  I haven’t yet thought through the MVC (model, view, controller) aspects of it … but I’m confident the RoR scaffolding can help there.

As for my project … well, I don’t want to say until I have it up and running … that way I can limit any future embarassment :)

One thing that I wanted to be able to do, but I don’t think I can is to allow the creation of new classes via the web interface.  I’m pretty sure this is possible, but the problem I’m running into is that I will have commonly used classes available, and if a custom class is needed it will probably require custom logic.  I could set up a tiny web based ruby development environment, but that’s a bit of a larger project than I want to try right now.  So for now, the custom creation is via Ruby.  Though you can choose the class at run time via the web (at least that’s the plan).

Step 1 will be to actually create the rails project, and to create the MVC that will allow the end user to choose a data container for entering in addressing data.  This “addressing container” will be one of the building blocks of the project.


Warning: mktime() [function.mktime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 24

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 30

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 32

Warning: mktime() [function.mktime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 24

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 30

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 32

Back again


Warning: mktime() [function.mktime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 24

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 30

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dmarti21/www/blog/wp-includes/functions.php on line 32
September 8th, 2008

My wordpress version is probably years out of date (still seems to work though), and I was last active during the last presidential election cycle, and here we are at a new one.  I don’t know if I’ll have any political rants (I don’t think so but who knows), but I do plan on documenting a project I’m starting using Ruby on Rails.  We’ll see how it goes …



Deprecated: Function split() is deprecated in /home/dmarti21/www/blog/wp-includes/cache.php on line 215

Deprecated: Function split() is deprecated in /home/dmarti21/www/blog/wp-includes/cache.php on line 215