Dan Milliron's Blog

Art Lit 2.0 Websites Are Here!

Posted by Dan Milliron Thu, 05 Oct 2006 13:10:00 GMT

The Art Literacy website program for Uplands Elementary and other Lake Oswego schools is back!  The following websites are "fully operational" (just like the Death Star in Star Wars...):

The website is easier to use than last year because the master schedule is right on the home page and because the new "My Schedule" button takes you directly to your personal schedule with one click.  The site also received a much-needed facelift; the layout is cleaner and more accessible to all browsers.  For you techno-geeks, the site now uses AJAX for smoothness and Rails with Richard White's scaffolding for styling.

The Art Literacy curriculum is a terrific way for kids and parents to learn about art and art history.  The program allows me to build rapport with my children's teachers and classmates.  I love to visit the classrooms each month and directly see how things are going for my kids.  I hope the websites make it easier for school coordinators and parent volunteers to enjoy the benefits of this wonderful program.

no comments

meantime_filter vs. exception_notification

Posted by Dan Milliron Tue, 19 Sep 2006 19:36:00 GMT

Two very useful Rails plugins that don't play well together are meantime_filter and exception_notification. The first allows controllers to tap into the functionality of ActiveRecord's "with_scope" and the second enables your website to send email notifications when an internal error occurs. Unfortunately, they cannot be used together in the same application...

The problem is that Rails is getting confused when meantime_filter re-aliases only one of a pair of related ActionController functions:

   action_controller/filters.rb:perform_action_with_filters
   action_controller/filters.rb:perform_action_without_filters

The result is that internal errors show up in the log file, but no email notifications are sent.

I have found a way to patch meantime_filter with a complete pair of unique aliases that do not confuse the existing Rails aliases. The patch for meantime_filter 0.1.2 is to replace lines 71-86 in plugins/meantime_filter/lib/meantime_filter.rb with:

def self.included(base) #:nodoc:
  base.module_eval do
    alias_method :perform_action_without_meantime, :perform_action_without_filters
    alias_method :perform_action_without_filters, :perform_action_with_meantime
  end
end

def perform_action_with_meantime
  during_action { perform_action_without_meantime }
end

This works for me in both the production and development environments. If you have any comments, I am anxious to read them.

Posted in  | 5 comments

Daily Quotations for Typo

Posted by Dan Milliron Mon, 21 Aug 2006 06:45:00 GMT

This is chapter two in the story of my wife's new blog, which I have built with Typo.  In chapter one, she commissioned me to create multiple sidebars so she could have top, left, and right sidebars.  For that job, I was paid handsomely, not.

For my next task, she requested a "Daily Quotation" sidebar component. Her blog is about family traditions, and she wants to display a family-oriented quotation picked randomly from a list that she could control. I already knew how to implement a new sidebar component from my work in chapter one, but this Daily Quotation component would require managing a new database of quotation texts, along with randomizing their schedules.  So I dug back into the Typo code and figured out how to add a new controller, views, and model without changing any existing code.

The good news is that there are enough hooks in Typo to add a simple combination of  MVC pieces.  The bad news is that the hooks are more of a kludge rather than a first-class extension.  That's because Typo does not currently have a formal extension system that allows arbitrary new controllers, etc.  Bottom line: I had to use the TextFilter mechanism as a backdoor through which to squeeze my new quotation controller.

I won't go into the gory software details, but I will explain how the Daily Quotation component works, in case you want to use it in your Typo blog.  And you are indeed very welcome to use it.  After you install the files by unzipping them as per the instructions below, you will see a new sidebar component , "Daily quotation", available in the /admin/sidebar page.  Drag that over to the Active column and publish your new sidebar (click the "Publish Changes" button at the bottom of the /admin/sidebar page).

At this point, you will see a placeholder quotation when you go to your blog page.  That's because you have not yet added any quotation content.  The Daily Quotation component does not come with any quotations; you must provide them.  In my wife's case, she had collected 188 quotations relating to family life.

Creating a Quotation File

After you have collected some quotations, you can put them in your blog by following these steps:

  • Go to the /admin/sidebar page and click the word "managed" where it says "private database managed by the administrator".  This will display the "Daily Quotation Administration" page.
  • In the "Download the Quotation Database" section, follow the instructions to get the current file of quotations.  Save the file to your computer.
  • Edit the quotation file and add your quotations.  At the least, each quotation must have the text of the quotation.  You can also include the author's name in the "Author" field.  Lastly, if you would like to control the date when the quotation appears in your blog, you can explicitly specify a date.  For example, if you have a Halloween quotation that you want displayed on October 31, 2006, you can put that date in the date column.  Any quotations that do not have an explicit date will be automatically schedule for a random date.
  • Upload the new quotation file via the form in the "Upload a Quotation Database" section of the of the "Daily Quotation Administration" page.  Your new file will completely replace the previous one, so if you only wanted to add more quotations, be sure not to remove the existing quotations when you edit the downloaded file.
  • The "Daily Quotation Administration" page will tell you how many quotations you have in your file, as well as the the date when you run out.  After that date, quotations will be chosen at random from the existing set, with no more guarantee that every quotation will appear exactly once.

To Install the Daily Quotation Component

  • Download the zip file.
  • In the top-level directory of your Typo Rails application (the directory containing "app", "db", "public", etc), extract the contents of the zip file, e.g. unzip daily_quotation_1_1_0.tgz
  • Verify that you now have a file at components/plugins/sidebars/daily_quotation_controller.rb and a directory at components/plugins/sidebars/daily_quotation
  • You may need to reboot your blog server, but most likely, you won't.
  • Go to your blog's admin/sidebar page and verify that the "Daily quotation" sidebar component is listed in the left-hand column.

Posted in  | no comments

Multiple Sidebars in Typo

Posted by Dan Milliron Thu, 10 Aug 2006 02:26:00 GMT

The standard Typo blog framework allows only one sidebar. This became an important issue when my wife decided to start a weblog recently. Since my own blog is powered by Typo, I offered to host her blog with Typo on my server. I pointed her at a site full of Typo themes and told her to choose one she liked.

Guess what; she didn't like any of them. Her chief complaint was that they all had just one sidebar. I naively said, "No problem," because I figured we could probably throw a switch in the Typo engine and get two sidebars. Well, it turns out there is no such switch, or this article would be moot.

So I solved the problem in the simplest way I could think of. I created a new sidebar component, "Divider", to join the existing Typo components such as "Flickr" and "Categories" in the admin/sidebar page of your blog. To create multiple sidebars, you simply drag-and-drop a Divider component into your sidebar element stack where ever you want to split the sidebar into more than one piece. Then you use a theme that knows how to extract and position the sidebar chunks. If your theme is unaware of how to use multiple sidebars, no problem, because the Divider components don't generate any HTML, so they will be ignored. The Divider component comes with two helper functions for extracting the sidebar chunks, and those helper functions are available to the code in the theme's default.rhtml file.

I am making the "Divider" component freely available. You can download it below. I am also making available a simple dual-sidebar theme (based on the plain "Scribbish 2.0" theme). The documentation that comes with the Divider component shows an example of a three-sidebar theme (top, left, right), if you want something even more complex than the dual-sidebar theme.

My wife has plans for some other features in her blog that are not currently available in Typo, including a daily quote component, a polling component, and a guestbook component. I will be developing these over the next while and will publish them (for free) as soon as possible. So watch this space for more Typo sidebar components coming up!

To Install the Divider Component

  • Download the zip file.
  • In the top-level directory of your Typo Rails application (the directory containing "app", "db", "public", etc), extract the contents of the zip file, e.g. unzip divider_1_1_1.zip
  • Verify that you now have a file at components/plugins/sidebars/divider_controller.rb and a directory at components/plugins/sidebars/divider
  • You may need to reboot your blog server, but most likely, you won't.
  • Go to your blog's admin/sidebar page and verify that the "Divider" sidebar component is listed in the left-hand column.

To Install the Dual-Sidebar Theme

  • First download the Divider component (see above).
  • Download the zip file.
  • In the top-level directory of your Typo Rails application (the directory containing "app", "db", "public", etc), extract the contents of the zip file, e.g. unzip dual_sidebar_theme_1_0_0.tgz
  • Verify that you now have a directory at themes/dual_sidebar
  • You may need to reboot your blog server, but most likely, you won't.
  • Go to your blog's admin/themes page and verify that the "DualSidebar" theme is listed.

Posted in  | 2 comments

Chronicles of Emarm

Posted by Dan Milliron Mon, 31 Jul 2006 16:44:00 GMT

Sometime soon, I plan to launch www.emarm.com, a website that uses simple email forms to help parents and teachers work together for the benefit of students. The inspiration behind emarm.com is last year's successful experiment that helped my child in the first year of junior high school.

I am developing emarm.com alone, using the Ruby on Rails web application framework. Rails is a recent technology that has a burgeoning community with many new members seeking help with strategies and tactics. I want to contribute to the body of literature targeting the Rails newbie by chronicling the evolution of emarm.com from concept through launch. I have completed four other Rails projects, and have enough experience that I feel I might offer some help to others interested in trying Rails.

If you have not heard of Rails, this series of articles will not interest you. I will assume that the reader is familiar with Model-View-Controller (MVC) architecture and the contents of "Agile Web Development with Rails". I recommend purchasing the PDF version of the second edition, which, at the moment, is still evolving but completely useful nonetheless. The first part of the book details the development of a fictitious website, emphasizing incremental "agile" development. I, too, adhere to the concepts of agile development, but my classical software engineering experience helps me value a good up-front design plan, as you will see in this series of articles.

Waterfall plus Agile

In other words, I believe that a software design process should enable incremental product development that is agile enough to accept product changes and enhancements with a minimum of effort. But that doesn't mean the entire design must start with zero features and add one feature at a time. So I blend together a respectable initial design process (a "waterfall model") with proven strategies for accommodating future change and I get an efficient product life-cycle. The great thing about Rails is that it provides a superb level of abstraction for many great software engineering concepts, such as decoupling, encapsulation, refactoring, etc.

An outline of my development process for emarm.com is:

  • [optional] Start with a prototype (last year's experiment for my child)
  • Write use cases
  • Design the class schema in UML
  • Translate the class schema into Rails migrations, models, and unit tests
  • Scaffold an entire administration application for the database
  • Design the site's deployment process and set up a production server
  • Develop controllers for the use cases not covered by the scaffolding
  • Create views and email templates
  • Launch!

Guest Topics

Some of the elements that will be important to emarm.com are scaffolding, user authentication (accounts with passwords), online financial transactions, REST/CRUD architecture, automatic emailing, and scheduled background processing. I will cover all these topics in the remaining articles of this series.

For those of you interested in the details of my development platform, I write code on a Windows laptop running Eclipse, Rails, MySQL, and Webrick. For revision control, I use subversion with a repository local to my laptop (risky, I know; cross your fingers for my hard drive!) because I am on the road enough that it's nice to be able to check in code without a network connection. I have my own static IP address, several domain names, and a Linux server running Apache and FastCGI at my house. I use Capistrano to deploy Rails applications to that server. I may switch to Lighttpd and/or Mongrel in the future.

In the next article, I will write about the data model design for emarm.com...

Posted in  | no comments

A Great Way to Help Your Student!

Posted by Dan Milliron Thu, 13 Jul 2006 22:59:00 GMT

Parents and school teachers have an important common interest: the student. But the relationship between parent, teacher, and student can be difficult to manage. The weakest side of the triangle is most often the communication between teacher and parent. In too many cases, a parent learns of their child's difficulties only when they receive an official progress report from the school. Or they only see the teacher once a semester at conference. Frequently, the information comes so late after the onset of problems that the parent has little chance of helping their child get back on track.

I have discovered a terrific way for my wife and me to work with our child's teachers to help our child be more successful. My wife and I had fallen into the rut of frequently asking our child if homework was caught up and whether school was going well. As you might expect, we always heard positive things from our child, even when we probed deeper regarding the occasional assignment we knew about. Even after a semester of negative progress reports, we still were unable to break our cycle of optimism the next semester.

We tried lots of things to assist our child. We dedicated a portion of our house to homework. We set rules about how much time must be spent studying. We took shifts supervising progress. But all our efforts were handicapped by one huge deficiency: we had no clue how our child was performing from the view of the teachers. Every day, we were shooting in the dark because we had no accurate feedback about the status of our child's assignments and participation.

If only we could have received frequent information with specific details about how our child was doing. Then we would have had a real chance of breaking through the barriers that had developed over time. I don't want to give too many personal details, so I'll just say that a weekly communication from the teachers would have enabled my wife and me to see how our child was actually doing and to help our child do better.

Without better information from our child's teachers, we would never be able to help. I considered setting up weekly phone conferences, but immediately realized that such phone calls would be a huge imposition on the teachers. Was there some way to regularly learn our child's status without straining the teachers? The answer was yes, because each of the teachers uses e-mail on a daily basis, and I know how to design an e-mail message that contains a survey form. So I developed a dead-simple e-mail that the teacher can respond to with just a few clicks to answer yes/no questions about how our child is doing, with an optional space for comments. The teacher clicks the "Submit" button in the email and that's all there is to it!

The first time I sent the e-mails, I was worried the teachers would hate them. I was thrilled when the first round of responses included comments like, "I love this form!" After just one week, the comments started to read, "Your child is doing much better now," because at home, we could finally give our child the specific, focused help that was needed. Week after week, the teachers were enthusiastic about letting us know how our child was doing.

I started showing the e-mail forms to my friends and colleagues. Nearly every one of them said, "Hey, we could sure use that. Can you set it up for us, too?" After enough encouragement, I have decided to make the e-mail system available from a web site so any family can use it. The web site will automatically send the e-mails once a week. The responses will go to the parents and to the web site for archiving. At the web site, parents will be able to control e-mail schedules, view past reports, and maybe even look at trends over time. I might even include a forum for parents to share ideas on helping their children succeed in school.

I plan to have the web site operating in November 2006. To cover the costs of server hosting, I plan to charge a small fee. My wife suggested that 25% of the fee go back to the individual schools, which is a great idea. That way, there is some benefit to the schools for the effort required of the teachers. My good friend Matt came up with the name "E-Marm", and I think that's a wonderful name for a web site, so look for www.emarm.com soon!

Posted in  | 3 comments

How Rails Creates Web Developers

Posted by Dan Milliron Thu, 13 Jul 2006 01:44:00 GMT

Take a software engineer geek who knows next-to-nothing about SQL, HTML, or any other web technologies, and tell them that developing a data-driven web application requires little more than the good software design principles they already know. If they are naive enough to believe you, show them Ruby on Rails, and buy them one gift: the PDF version of the book Agile Web Development with Rails.

Before you know it, they'll be using the Rails hammer for every nail they can think of. They may never become expert in pure SQL, HTML, XML, or any of the other support technologies, but they won't need to. Okay, they have geek osmosis, so they probably will absord those technologies...

Can't you make the same claim about Java, or PHP, or my-fave-tech?

No, and here's why. The other well-known frameworks lack two key ingredients: a prescribed architecture and an expandable programming language. The various frameworks do offer a higher level of abstraction and a programming language for customization, but only Rails dictates how to architect your web application and only Rails has the Ruby programming language.

MVC Architecture Rocks for Web Apps

Model-View-Controller (MVC) is a pattern for constructing software that is particularly well-suited for designing data-driven web applications. Rails has first-class support for developing MVC applications. In fact, don't even bother with Rails unless you can express your application in terms of MVC. "But I don't want my framework dictating the architecture," you might say. Fine, but for the hordes of good software developers who aren't fluent in the alternate architectures, Rails is a benevolent mentor guiding them past the initial obstacles confronting every engineer.

Think of it this way. Suppose you are stranded on an uninhabited island and must build a shelter. If you are stranded with a structural engineer who is experienced in building jungle housing, would you tell her to mind her own business because you want to do everything yourself? Of course not. Rails does a favor for software engineers by kick-starting design projects with a proven architecture.

Ruby Kicks Programming Butt

Nearly every experienced programmer has strong religious opinions about which programming languages are best, and here's my opinion: Ruby is the most elegant and fun. I have written software in C, C++, Lisp, Java, Perl, Tcl, and Bash, and I know Python and PHP too. All have great strengths, but Ruby is my favorite all-around way to get small and large programs running. Whether I have to write 10 lines of code or create a system with 1 million lines of code, I am happiest doing it in Ruby.

But you don't even have to know Ruby to develop in Rails. You can do a whole lot of Rails programming without diving deeply into Ruby. That's why Rails has lifted so many new web developers from the non-Ruby trenches; because a decent engineer can be productive in Rails on Day One, even before finding out that Rails is an expansion of Ruby.

Rails vs Java vs PHP

So it boils down to this. If you are a good software engineer who wants to start developing web applications, do the following. Skip PHP altogether because you will grow out of it in a year and it will bog you down on large projects. Avoid Java unless you get paid by the number of lines of code, in which case you might also consider COBOL or ADA for web development. Leap ahead to Rails and you will be grateful every time you produce a web application in less time than it takes developers with other technologies to set up their data model.

Posted in  | Tags , ,  | no comments

Top 4 Features of the Art Lit Website

Posted by Dan Milliron Wed, 12 Jul 2006 15:57:37 GMT

After a year of operation at Uplands Elementary, these features of the art lit website seem to be the favorite:

Personalized Calendars

A volunteer or teacher can instantly see just the events and assignments that apply to them. The events include classroom lessons, trainings, and no-school days. If the volunteer has an assignment for the event, the assignment is highlighted.

E-mail Reminders

Two days before an event, the website sends an email reminder to all of the participants. Volunteer teams frequently use the reminder email as an adhoc mailing list for discussing plans. Team members can also send intra-team emails any time via the website.

Lesson Scheduling

Classroom sessions and assignments can be rescheduled online. The website doesn't allow an art cart to be accidentally double-booked. A master schedule makes it easy to see availability of the cart(s) and classrooms. The website automatically sends an email notification about schedule and assignments changes to the participants.

Lesson Plan Tracking

At each training meeting, the teams fill out a simple lesson plan sheet. The sheet records the assignments for the lesson (presenting, project leading, mounting/displaying, etc) and the choice of hands-on projects. After the plan info is entered into the website, the website automatically sends an email notification of the lesson plan to all participants.

Posted in  | no comments

What's coming in Art Lit 2.0?

Posted by Dan Milliron Tue, 11 Jul 2006 16:40:00 GMT

The new features in Art Lit 2.0 focus on the following goals:
  • Allow multiple schools to have their own art literacy site. Previously, just one school (Uplands Elementary) could have a site.
  • Support the art literacy programs in the junior high schools. In the JHS programs, volunteer teams are more ad hoc and not permanently associated with a teacher.
  • Contemporary styling! The first version of the site was long on function and short on style (a lot like me). It was the proverbial Russion train; it got the job done but was kind of klunky.
I expect to have an "open house" version of the site up and running in about a month (by Aug. 15). At this time, four grade schools (Uplands, Bryant, River Grove, Lake Grove) and one junior high school (Waluga) have signed up to have a site for the 2006-2007 school year. Each of them is recruiting a data entry administrator, and I will train those admins in early September. If you are the Art Lit Coordinator for an elementary or junior high school in the Lake Oswego School District, and you would like to have an Art Lit web site for your program, please send me an email.

Posted in  | no comments

Art Lit is on Hiatus!

Posted by Dan Milliron Thu, 06 Jul 2006 08:15:00 GMT

Where did the art lit web site go? It is on vacation getting rest and relaxation while Dan Milliron prepares the new 2.0 version. The old site would have hung around longer, but the host server machine got upgraded, so this was a good time to take a break.

Watch for announcements and articles leading up to the launch of Art Lit 2.0!

Posted in  | 1 comment