<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Crazy Or Genius?: Tag rails</title>
    <link>http://www.crazyorgenius.com/articles/tag/rails?tag=rails</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>When You Are Right 90% Of The Time, Why Quible Over The Remaining 3%?</description>
    <item>
      <title>TigerEvents 0.7.1 - It's About Time</title>
      <description>&lt;p&gt;So&amp;#8230;.. I have actually had a release version of Tigerevents for a long time now. 0.7.0 is actually powering my.dsu.ca now, but was never officially released. As I added several features since then, &lt;a href="http://www.crazyorgenius.com/articles/2006/10/01/microformats-microformats-microformats"&gt;as mentioned a while ago&lt;/a&gt;, I decided to just increment the release number, and push it out there.&lt;/p&gt;


	&lt;p&gt;This decision was prompted by an organization other than the &lt;span class="caps"&gt;DSU&lt;/span&gt; contacting me, saying they wanted to use it, and if I could just add this one little feature enhancement&amp;#8230;...&lt;/p&gt;


	&lt;p&gt;Needless to say, the idea of other people using this pleases me, and hopefully in the near future I can point out to other in production instances.&lt;/p&gt;


	&lt;p&gt;The code, as always, is available at the &lt;a href="http://sourceforge.net/projects/tigerevents"&gt;Sourceforge&lt;/a&gt;, and &lt;a href="http://rubyforge.net/projects/tigerevents"&gt;Rubyforge&lt;/a&gt; locations for download.&lt;/p&gt;</description>
      <pubDate>Thu, 25 Jan 2007 02:35:00 +0100</pubDate>
      <guid isPermaLink="false">urn:uuid:bbc9e7ed-82a5-4105-871a-6c17935bca16</guid>
      <author>Sean</author>
      <link>http://www.crazyorgenius.com/articles/2007/01/25/tigerevents-0-7-1-its-about-time</link>
      <category>Projects</category>
      <category>tigerevents</category>
      <category>rails</category>
      <category>ruby</category>
      <trackback:ping>http://www.crazyorgenius.com/articles/trackback/801</trackback:ping>
    </item>
    <item>
      <title>Finally Giving In</title>
      <description>&lt;p&gt;Over the last few years I have been asked to present something at various local conferences (mostly just &lt;span class="caps"&gt;CEOS&lt;/span&gt;). This has always ended up with me saying, &amp;#8220;sorry, I don&amp;#8217;t have the time&amp;#8221;. Recently, I have come to the realization that I am likely going to always be &amp;#8220;busy&amp;#8221; with various other things. So I made a decision.&lt;/p&gt;


	&lt;p&gt;More recently, I have been asked to give a talk at &lt;a href="http://deveast.com/"&gt;DevEast&lt;/a&gt;. Rather than my traditional &amp;#8220;sorry I don&amp;#8217;t have time&amp;#8221;, I decided to give in and accept. I am now going to be giving a talk about Ruby on Rails that will encompass a lot of the basics, as well as sharing some of my own experiences with it over the last year.&lt;/p&gt;


	&lt;p&gt;Win, lose, or draw, at least in a few days I will be able to say I&amp;#8217;ve tried.&lt;/p&gt;</description>
      <pubDate>Sun, 19 Nov 2006 18:03:00 +0100</pubDate>
      <guid isPermaLink="false">urn:uuid:1b675567-ca6e-4668-a50b-ef4760e8ab60</guid>
      <author>Sean</author>
      <link>http://www.crazyorgenius.com/articles/2006/11/19/finally-giving-in</link>
      <category>Life</category>
      <category>Geek</category>
      <category>ruby</category>
      <category>rails</category>
      <category>presentation</category>
      <trackback:ping>http://www.crazyorgenius.com/articles/trackback/209</trackback:ping>
    </item>
    <item>
      <title>Writing Database Code In Rails: Migrations and Neutrility</title>
      <description>&lt;p&gt;As I &lt;a href="http://torch.cs.dal.ca/~ssmith/?p=40"&gt;recently said&lt;/a&gt;, I switched TigerEvents over from using a MySQL input file to migrations. There were many decisions behind this choice.&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;I wanted the code to be database neutral. Using migrations would allow me to automatically support MySQL, PostgreSQL, and SQLite by making changes to one file instead of 3.&lt;/li&gt;
		&lt;li&gt;I know that the database for TigerEvents is going to change at some point in the near future. Rather than write multiple upgrade scripts manually, I could just use the built in migration functions to do it better.&lt;/li&gt;
		&lt;li&gt;If for some reason I make a mistake and problems occur on the production site, it is easier to roll back to a previous version using migrations than dump the database, roll back the code, reload the database, etc. (Note, we still make sure to back up the database, cause not doing that is just tempting fate)&lt;/li&gt;
		&lt;li&gt;Migrations will, in theory, make development easier. Someone made a change to the schema? Just run &lt;em&gt;&lt;strong&gt;rake migrate&lt;/strong&gt;&lt;/em&gt;, and your database is automatically updated. I think this is easier than reinitializing a database and then loading it with data repeatedly (though the second part of this can be handled with Fixtures).&lt;/li&gt;
	&lt;/ul&gt;&lt;p&gt;While an &lt;a href="http://glu.ttono.us/articles/2005/10/27/the-joy-of-migrations"&gt;awesome introduction&lt;/a&gt; to getting started with Migrations has already been written, I feel that the &amp;#8216;database neutral&amp;#8217; stuff is missing. Using my own experience, several items must be taken into account, mostly due to MySQL usage and certain programming that were being used.&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;Already Existant Database&lt;/strong&gt;&lt;/p&gt;


	&lt;p&gt;So we already had a database. A somewhat large database with a number of tables. I didn&amp;#8217;t want to spend a lot of time manually creating the migration code from scratch. Was there a quicker way? You betcha. There was a rake task called db_schema_dump which will dump all the table data from your database to a file called schema.rb. So, once we do that, all we have to do is copy this information to the self.up section of a migration and we are done, right? Unfortunatly, it is &lt;strong&gt;&lt;span class="caps"&gt;NOT&lt;/span&gt;&lt;/strong&gt; that easy. The problem is (in my case) that MySQL data types do not necessarily behave the same. Mostly, this deals with constraints, but also has to do with the boolean data type itself.&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;Constraints&lt;/strong&gt;&lt;/p&gt;


In MySQL, you can do int(8). In rails, this would be translated into something like &lt;code&gt;:integer, :limit =&amp;gt; 8&lt;/code&gt;. However, PostgreSQL only has smallint, integer, and bigint, not constraint values. Therefore, the previous rails code returns an error, as PostgreSQL chokes on the &lt;span class="caps"&gt;SQL&lt;/span&gt; command that rails sends it. Therefore, while it is true that you don&amp;#8217;t need to know specific &lt;span class="caps"&gt;SQL&lt;/span&gt; syntax, you DO need to know what kind of data you can feed various databases. For TigerEvents, I just generalized items and made the following changes:
&lt;code&gt;:integer, :limit =&amp;gt; 8&lt;/code&gt; became &lt;code&gt;:integer&lt;/code&gt;
&lt;code&gt;:integer, :limit =&amp;gt; 1&lt;/code&gt; which translated to tinyint(1) in MySQL became &lt;code&gt;:boolean&lt;/code&gt;
&lt;code&gt;:timestamp&lt;/code&gt; became &lt;code&gt;:datetime&lt;/code&gt; (which gave me extra functionality). Now, I by no means know if these are the optimal solutions, but they did work.

	&lt;p&gt;&lt;strong&gt;Boolean Data&lt;/strong&gt;&lt;/p&gt;


We have a few boolean flags in our database. However, MySQL does not have a boolean data type. Instead, tinyint(1) is generally used. Well, generally that is ok, as ActiveRecord will automatically use tinyint(1) when connecting to MySQL and boolean when connecting to PostgreSQL and SQLite. However, since we started out with MySQL, there were numerous statements such as 
&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;@newgroups = Group.find(:all, :conditions =&amp;gt; [&amp;quot;approved = 0&amp;quot;])&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
where 0 is supposed to indicate false. However, since this does not translate to false with PostgreSQL and SQLite, we have a problem. Solution: use placeholders. You are acually allowed to do this:
&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;@newgroups = Group.find(:all, :conditions =&amp;gt; [&amp;quot;approved = ?&amp;quot;, false])&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
ActiveRecord takes the value and automatically translates the value into the proper data type, depending on the database type.

	&lt;p&gt;So once again, while you don&amp;#8217;t need to know specific &lt;span class="caps"&gt;SQL&lt;/span&gt; query usage, it is important to keep data types general, and passed values abstracted if you want to create database code which is database neutral (at least for MySQL, PostgreSQL, and SQLite).&lt;/p&gt;</description>
      <pubDate>Wed, 23 Nov 2005 18:12:00 +0100</pubDate>
      <guid isPermaLink="false">urn:uuid:f22c340f171ad04deddfaaba1bccc54c</guid>
      <author>Sean</author>
      <link>http://www.crazyorgenius.com/articles/2005/11/23/writing-database-code-in-rails-migrations-and-neutrility</link>
      <category>Programming</category>
      <category>ruby</category>
      <category>rails</category>
      <category>migrations</category>
      <trackback:ping>http://www.crazyorgenius.com/articles/trackback/41</trackback:ping>
    </item>
    <item>
      <title>TigerEvents Breaks 50! (Downloads That Is)</title>
      <description>&lt;p&gt;One month after the first official release of TigerEvents and we have achieved the following:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;31 downloads on Sourceforge&lt;/li&gt;
		&lt;li&gt; 20 downloads on RubyForge&lt;/li&gt;
		&lt;li&gt;17 downloads directly from &lt;a href="http://www.tigeronrails.com"&gt;TigerOnRails&lt;/a&gt;&lt;/li&gt;&lt;/li&gt;
		&lt;li&gt;Currently Ranked 3,682/105,551 projects on Sourceforge (Top 5%!)&lt;/li&gt;
		&lt;li&gt;Currently Ranked 83/999 Projects on RubyForge (Top 10%!)&lt;/li&gt;
		&lt;li&gt;One individual (from the Netherlands) actually testing out trunk and submitting tickets&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;Wow, this totally, totally exceeds expectations.&lt;/p&gt;</description>
      <pubDate>Tue, 08 Nov 2005 01:27:00 +0100</pubDate>
      <guid isPermaLink="false">urn:uuid:c2da83df858b2db13081b8e2a13de007</guid>
      <author>Sean</author>
      <link>http://www.crazyorgenius.com/articles/2005/11/08/tigerevents-breaks-50-downloads-that-is</link>
      <category>Projects</category>
      <category>ruby</category>
      <category>rails</category>
      <category>tigerevents</category>
      <trackback:ping>http://www.crazyorgenius.com/articles/trackback/42</trackback:ping>
    </item>
    <item>
      <title>World Usability Day!</title>
      <description>&lt;p&gt;Today is &lt;a href="http://www.worldusabilityday.org/"&gt;World Usability Day&lt;/a&gt;. A day to work towards better user experiences in products and experiences. I also decided to use this day as a deadline for the  next release of &lt;a href="http://sourceforge.net/projects/tigerevents/"&gt;TigerEvents&lt;/a&gt;, one of the software packages I work on. 39 closed issues later&amp;#8230;............... a brand new release. All that remains is to migrate my.dsu.ca to a new server, upgrade to the new version, and then all users can revel in&amp;#8230;..... well&amp;#8230;.... errr&amp;#8230;....... actually, I must admit there isn&amp;#8217;t anything major in a regular user&amp;#8217;s perspective.&lt;/p&gt;


	&lt;p&gt;Removing that pesky sidebar proved troublesome (due to Javascripting and &lt;span class="caps"&gt;CSS&lt;/span&gt; issues), and is unfortunatly pushed back (I&amp;#8217;m working on it!). You will see that events actually have their formatting preserved, so no more giant block paragraph that is a pain in the ass to read. There are also some more subtle rearrangements and additions to some options, which I think will make posting events easier for people. Admins get a little more, mostly avoiding huge lists of groups and users when trying to navigate (pagination helper is your friend).&lt;/p&gt;


	&lt;p&gt;And the backend stuff is where most of the changes occured. I personally refactored the code so that the authentication stuff is easier to drop into other code (important since we want to use it in multiple projects. Additionally, I refactored the code to make the entire system database neutral, and to have as much as possible done through ruby. This includes important things such as setup and schema migration. This was the longest and largest changeset I have done in a while, and I am glad it is over. Of course, I need to pass this on to several budding developers so they don&amp;#8217;t make the same mistakes, so&amp;#8230;....... check back at some point in the future.&lt;/p&gt;


	&lt;p&gt;What however, is the future of this project? The individuals working on it (and by that I mean myself and &lt;a href="http://racon.net"&gt;Oliver&lt;/a&gt;) have decided we want to refocus on putting the &amp;#8216;my&amp;#8217; into the &amp;#8216;my.dsu&amp;#8217;. Upcoming, expect to see new skins, a better actual interface devoid of those confusing multiple columns, and other things that will help the &lt;span class="caps"&gt;USER&lt;/span&gt; kick ass. So think of this World Usability Day not as a day for which we bring out a ton of usability fixes, but a day where we begin to devote more attention to where it is needed.&lt;/p&gt;


	&lt;p&gt;You know, after we take a much needed break.&lt;/p&gt;</description>
      <pubDate>Thu, 03 Nov 2005 19:44:00 +0100</pubDate>
      <guid isPermaLink="false">urn:uuid:7a03c0ef0eec803030598be96ae642fc</guid>
      <author>Sean</author>
      <link>http://www.crazyorgenius.com/articles/2005/11/03/world-usability-day</link>
      <category>Programming</category>
      <category>Projects</category>
      <category>ruby</category>
      <category>rails</category>
      <category>usability</category>
      <category>refactoring</category>
      <trackback:ping>http://www.crazyorgenius.com/articles/trackback/40</trackback:ping>
    </item>
    <item>
      <title>Woo! TigerEvents 0.5.0 Public Release</title>
      <description>&lt;p&gt;Finally, after long hours, little sleep, and lots of work, the 0.5.0 release of TigerEvents, code named &amp;#8220;It&amp;#8217;s Finally Our So I Can Take A Break&amp;#8221; was released the other day on both &lt;a href="http://sourceforge.net/projects/tigerevents"&gt;Sourceforge&lt;/a&gt; and &lt;a href="http://rubyforge.org/projects/tigerevents/"&gt;Rubyforge&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;The focus of this release was getting all the proper administration interface stuff working properly (sorry front end only users) and trying to document it enough so a person can take the code, set it up, and run it on another machine.&lt;/p&gt;


	&lt;p&gt;Now that the initial file release is out, all I have to do is upgrade my.dsu.ca (merging is going to be a pain in the ass), work on 0.6.0 (which involves merging my development branch back into the trunk, ugh), and redo that ugly, ugly interface.&lt;/p&gt;


	&lt;p&gt;Regarding the interface, I plan to do something even more minimalistic than some people&amp;#8217;s ideas (the one&amp;#8217;s I am getting are awesome though, don&amp;#8217;t stop). It will, at the very least, grant more open space, as opposed to cramming everything important into a small area. A primary advantage of starting out small is that it will be simple (except for all the XMLHTTPRequest stuff I need to do), and if people want more, I just add more, instead of scalling back and forth.&lt;/p&gt;


	&lt;p&gt;Oh, and I will do my best to get rid of that blinking text box.&lt;/p&gt;</description>
      <pubDate>Fri, 07 Oct 2005 12:42:00 +0200</pubDate>
      <guid isPermaLink="false">urn:uuid:200181e6942ded74440f083716e434d1</guid>
      <author>Sean</author>
      <link>http://www.crazyorgenius.com/articles/2005/10/07/woo-tigerevents-0-5-0-public-release</link>
      <category>Programming</category>
      <category>Projects</category>
      <category>ruby</category>
      <category>rails</category>
      <category>tigerevents</category>
      <trackback:ping>http://www.crazyorgenius.com/articles/trackback/36</trackback:ping>
    </item>
    <item>
      <title>A License To Bitch</title>
      <description>&lt;p&gt;As already &lt;a href="http://torch.cs.dal.ca/~ssmith/?p=29"&gt;mentioned&lt;/a&gt; I have been working on a project called TigerEvents, which powers the &lt;a href="http://my.dsu.ca"&gt;my.dsu.ca&lt;/a&gt; website.&lt;/p&gt;


	&lt;p&gt;This project, written entirely in &lt;a href="http://www.rubyonrails.com"&gt;Ruby On Rails&lt;/a&gt;, took 4 part time students 2 months to code a working, publicably usable beta. Pretty sweet, since some of us had other, paying, supposedly full time jobs on the go as well, and all of us had other responsibilities.&lt;/p&gt;


	&lt;p&gt;The &lt;a href="http://my.dsu.ca"&gt;my.dsu.ca&lt;/a&gt; website has gotten 102430 requests since Aug 25. Not bad I suppose, but I think we can do better than that.&lt;/p&gt;


	&lt;p&gt;The main problems? I know it, you know, it&amp;#8217;s the visual layout. Sure it sucks. A layout like this is when a graphical artist that is supposed to do work totally flakes out and techies are left in charge. Also high up on that list is usability. Some things work well, some things&amp;#8230;...... not so well (hey, it&amp;#8217;s beta). So how do we fix this? Well&amp;#8230;..... I am hoping that you, the public, the intended audience, the actual, non-involved &lt;span class="caps"&gt;USERS&lt;/span&gt; could give me a hand here. Let me know what you like, let me know what you don&amp;#8217;t like, let me know what &lt;span class="caps"&gt;YOU&lt;/span&gt; would like to see.&lt;/p&gt;


	&lt;p&gt;Go ahead, chew me out, rip it to shreds, praise it, stomp it, love it, hate it. Just give me something I can use.&lt;/p&gt;</description>
      <pubDate>Tue, 04 Oct 2005 21:16:00 +0200</pubDate>
      <guid isPermaLink="false">urn:uuid:b784f23e30d0ddbc65836896fff908aa</guid>
      <author>Sean</author>
      <link>http://www.crazyorgenius.com/articles/2005/10/04/a-license-to-bitch</link>
      <category>Geek</category>
      <category>Programming</category>
      <category>Projects</category>
      <category>Work</category>
      <category>ruby</category>
      <category>rails</category>
      <category>tigerevents</category>
      <trackback:ping>http://www.crazyorgenius.com/articles/trackback/35</trackback:ping>
    </item>
  </channel>
</rss>
