Feeds

Blog

Monday, April 25, 2005

What Kind of American English Do You Speak?

Looks like I speak pretty standard english - a bit sad that I am not that big a yankee or dixie. Maybe I should start shouting Y'all more often :-)

Your Linguistic Profile:
  • 65% General American English
  • 20% Yankee
  • 10% Dixie
  • 5% Upper Midwestern
  • 0% Midwestern

Try the test your self at the URL http://www.blogthings.com/amenglishdialecttest/.
posted by Brian Jørgensen at 8:11am.
permanent url: http://qte.dk/blog/archive/24
Saturday, March 12, 2005

USA

In a few hours I and the SW6 folks will start our trip to Copenhagen, Paris and finally San Francisco.

During our trip we will update the SW6 Study Trip blog on a daily basis.

So long.
posted by Brian Jørgensen at 7:12pm.
permanent url: http://qte.dk/blog/archive/23
Friday, March 11, 2005

Computer History Museum @ Channel 9

Next week we are going to the United States, more precisely San Francisco. During our trip we are going to visit the Computer History Museum in Sillicon Valley.

While reading some blogs I came across Channel 9, where they had a video entry about the Computer History Museum.

I have not watched the video yet, maybe I should... Anyway, here is a link to the video entry.
posted by Brian Jørgensen at 10:03am.
permanent url: http://qte.dk/blog/archive/22
Sunday, March 06, 2005

Linuxforum 2005 - Take one

We just got home from dinner half an hour ago after a long day at Linuxforum 2005.

I have just uploaded the first set of photos taken by Kim Schulz, find them here.

I will post more blog entries tomorrow when I have had some time to process the impressions (and most importantly had some sleep :-) )
posted by Brian Jørgensen at 12:13am.
permanent url: http://qte.dk/blog/archive/21
Sunday, February 27, 2005

Ruby on Rails

After Kristian having mentioned Ruby on Rails (RoR) numerous times, I finally decided to give it a go. From what Kristian mentioned and from what I have read on the net, RoR should be able to make web developers much more efficient.

Installation:
In order to install RoR you first need to install Ruby - obviously.

# urpmi ruby

RoR is primarily distributed using the RubyGems tool, from what I can tell it works basically like Perl's CPAN, apt-get, urpmi etc. First you fetch the RubyGems package from RubyForge.

# tar zxf rubygems-0.8.4.tgz

# cd rubygems-0.8.4

# ruby setup.rb

Before running the post-installation script, I had to comment out the line that attempts to install windows batch files, since that procedure does not work on my Linux system.

# ruby post-installed.rb

# gem install rails

Accept all the dependencies, and you should have a fully functional RoR installation.

Testing the installation
Next of, I decided to create a small application in order to test the RoR. I a few weeks I am going on a trip to San Francisco, and we are currently planning the trip, so why not create an application that can help.

The RoR development strategy is based on:

DB design -> Controllers -> Model -> Layout

or at least that is how I remember reading it :-)

The clever thing about RoR is that based on your database design it will automatically map entries in the database to instances of objects. I wanted to manage a set of events, thus I created a controller named event and a database table named events (RoR will look for a plural version of your controller, and is smart enough to look for "companies" when you have a controller named "company").

I had read that RoR would make it possible for me to specify many-to-one, one-to-many relationships between two objects, and wanted to see how easy it would be to implement and how useful it would be.

My Event class got a

belongs_to :day

And my Day class got

has_many :events

Having at the same time added a day_id to the events database table, all day objects would now have a .events array of all events within that day. I then do not have to handle all data retrieval my self.

Scaffolding
Scaffolding make it easy to start working with data manipulation (create, update, view and list) and automatically handles entries in each data element based on the database schema. Just insert the following line in a controller class will create the framework for manipulating that data object automatically:

scaffold :day

Next, I wanted to change the default look of the day list, so I could get a full view of our trip. I added a definition for the list action, and changed the behavior so that it
  • Get a list of all days
  • Sort the list based on a timestamp
  • Let the layout template for the list handle the data presentation.
    • Create a file app/views/day/list.rhtml
    • Specify presentation in the list.rhtml file.

When users go http://host/day/list the will get the new presentation of the trip plan.

The Scaffolding feature is not intended to be used in the final application, but is meant as a way to make it easy to manipulate data in the start-up phase.

Specifying layout
After having specified layout of the planning overview, changed creation and update formulas for events it was time to create a layout for the application. I created a standard.rhtml file in app/views/layouts/standard.rhtml.

Adding the following line to both my controllers (day and event) make both controllers use the layout.

layout "standard"

Cleaning up behavior
I added a few buttons on the overview page, so users could go directly to the "Add new event" page. But when users created or updated an event, they would return to event/list or event/show/123. Instead I wanted them to return to the overview page, easy enough, just had to add a small redirect in each of the actions

redirect_to(:controller => "day", :action => "list")

Roundup
That is it, I have finished my small trip planner web application within a few hours. My first impressions are that Ruby on Rails is a neat framework that in some cases could actually speed-up application production. Some of the helpers are really cool, and the whole idea of working with controllers for web applications is neat. Actually we are already doing this in large parts of Fundanemt :-) Ruby on Rails does as well try as hard as it can to make URLs as readable as possible (that was a lot of "as" haha), and as a big fan of readable URLs that just makes me wanna go WOHOO.

One of the down sides of Ruby on Rails is that it is based on Ruby, thus developers will have to learn a new programming language (how ever beneficial this new language might be) I do not find the syntax all that intuitive.

Anyway, that is it for now, I might return with more to report when I have dug deeper into Ruby on Rails. Potential NEAT is all I can say at the moment :-)
posted by Brian Jørgensen at 7:58pm.
permanent url: http://qte.dk/blog/archive/20
« Previous 1 2 3 4 5 6 7 8 9 10 11 Next »