Tonight’s presentations and some other matters

Posted by john in Announcements

We haven’t had a formal announcement in awhile, so here it is.

(1) Remember: Due date for final projects is Sat., Jan. 19, ideally by 5 PM.

(2) One thing I have been remiss about is the best location for your writeup. Please put it in readme.txt in the root, as you did for assignment 3. If you must use Word, PDF, etc., then still call it readme but use the appropriate file type, e.g., readme.pdf

If you resort to some alternative — for example, using RDoc and then having fully generated RDoc’s — make sure that there is absolute clarity when you hand in so that we know where to look.

Do MAKE SURE that your migrations can create the database from nothing, and be absolutely clear about ANY requirements beyond the defaults — regarding anything that’s not pre-configured / setup in your ZIP, e.g., e-mail settings, database names, and anything else you can think of. As has been the case for the whole semester, we assume Rails 1.2.3. I am aware of the fact that some of you are on 1.2.5 or, gasp, 2.0.x, which we can probably handle, but if there is a serious snag because of versions, it is your problem, not ours.

(3) For the first set of presentations, the attendance was largely people who were presenting either on that date or for tonight; but, really, everyone is invited. I will hang out for an hour afterwards for anyone who has last-minute questions. I’ve been answering a fair number of questions in e-mail which seems to be going well, but if you need more, for instance, using CampFire, PLEASE LET ME KNOW. Unless you complain, I will think that everything’s ok.

(4) Also do note that I will try to be online Saturday morning, but at that late date, while I can help, I may not be able to help a lot. I’m sorry about this, but that is part of the peril of leaving things to the last minute.

(5) Tonight’s presenters, starting at 7:35 PM in Sever 308 are:

Louise - Quilt fabric sharing
Steve M. - Web-based management of PC automation
Jason - Office coffee break management
Andrew and Jesse - Cook’s Compass

Schedule for final project presentations

Posted by john in Announcements

Below is the schedule for our two meetings of presentations on final projects. Please come to both if you can.

Also: Please note the times and places. Tomorrow evening I will need to leave campus no later than 6:35 to be at the Boston Ruby Group meeting (in Kendall Sq., to which you are all, of course, invited).

If the presentations finish early, I will leave early.

SCHEDULE

(presenters: we will decide on the order at the meetings)

Jan. 8 - Sever 207 - 5:35 PM

Darryl - ASL game scenario and rating system
Tracey - Personal medical tracking
Liana - Audition management
Keith - Library Management

Jan. 16 - Sever 308 - 7:35 PM

Louise - Quilt fabric sharing
Steve M. - Web-based management of PC automation
Jason - Office coffee break management
Andrew and Jesse - Cook’s Compass

John will stick around for the 2nd hour to provide individual help if
it is needed.

Changes to schedule for Tues., Jan. 8

Posted by john in Announcements

First, apologies for those of you who showed up at class last night –
I should have been more clear that there would just be the two
meetings on the 8th and the 16th.

Now, regarding the 8th:

I would actually like to have the presentations starting at 5:35
(rather than 6:35). Let me know if that would be a hardship. (For
those of you who drive, the parking situation may actually be better
because a lot of people leave the square at that time).

I will bring some snacks to make this easier.

Then I would like to actually cancel the in-class hour of consulting
by me. What I will do is provide some on-line time via the Campfire
app.

The reason for this is that the Boston Ruby Group is also that night
(the 8th), and it’s going to be at my office, and I am having a
difficult time finding another tenant in 1 Broadway who can be the
host starting at our normal time. And, of course, everyone in the
course is invited to the Ruby Group meeting: One of the speakers will
be the author of Practical Ruby Projects (this is a different book
from Practical Rails Projects, which seems like a good one).

The upshot:

1. Have presentations at 5:35 not at 6:45: OK?
2. Replace in-person help with on-line.

Meetings in January 2008

Posted by john in Announcements

We have two meetings in the next two weeks.

I’ve asked those who are doing their own projects (other than CCC) to present briefly. The format for presenters will be to talk BRIEFLY about any aspect of your project that interests you: You might demo it; you might talk about something neat that you did; you might show the schema; then we will ask some questions. If you’re nearly done, then this will be great for final tuning. If you’re getting started, then this is a great chance for a “sanity check” before you get too deep in it.

If you are one such, e-mail to me and to Amy separately so we can see who will be on what date. I do know that some of you have told me which date you would prefer, but e-mail us again so we can make a list.

Everyone else: Come to one, or the other, or both, as you see fit.

For each meeting, there will additionally be a second hour when I will hang out in the classroom to answer questions, hear how you’re doing with your final project, etc.

And here are the dates / times / meeting rooms:

Tuesday, Jan. 8, Sever 207:

5:35 - 6:30: I’ll be in the room in person
6:35 - 7:35: Presentations by final project folks

Wednesday, Jan. 16, Sever 308:

7:30 - 8:30: Presentations by final project folks
8:35 - 9:35: I’ll be in the room in person

These meetings places MAY be tweaked at the last minute, according to extension. So keep your eye on e-mail and the course site as the date approaches.

Implementing a great final project

Posted by john in Assignments, Announcements

Last revised: 22-Dec-2007, 2 PM: You are to implement the e-mail plus TWO (2) of the other features.

Original: 22-Dec-2007, 11 AM

NOTE: This page is the “official” version of the requirements for the final project. Please add comments here, not in the e-mail list. If we add information here, we will announce it via the e-mail list.

In this post we want to break down the 7 categories for “additional features.” The final project is your version of CCC from assignment 5, with additional features (the other option was to propose a new project with similar complexity to CCC, implement that, and then add the additional features).

One additional feature is required; you get to chose the other two.

A very important note: There is no “right” way to implement the following. What you are reading are requirements. We are not going to spell out the implementation, except to point you to certain places in the code. Part of your grade will be based on your ability to move from requirements to implementation.

Tips

  • “What is the simplest thing that could possibly work?” (Kent Beck)
  • “Don’t Repeat Yourself” (DRY - Dave Thomas and others)
  • get it working first
  • use good taste (if you get your code working, and it looks like a hairball, see if you can make it more understandable)
  • Don’t forget it’s Ruby; write like a Rubyist

Writeup

Please provide a writeup of what you have accomplished in the final project. Anything new should be described in terms of what the user experiences, and then in a separate section, you should explain how you did it. In other words, the writeup should have two sections:

  • Use Cases
  • Implementation

The easiest way to write is to think about your intended reader. For the use cases, the reader is someone who needs to know what is going to happen. The use case is essentially the “story” of the user experience, using the vocabulary of the application (Users, Playdates, Invitations, etc.), just as we did for the assignment overview. That reader might be someone in QA, a VP of marketing, or someone who is evaluating your product. For the implementation section, the intended reader is another developer. Explain to that reader what they need to know to understand, maintain, and modify your code.

It is hard for me to imagine that a writeup would be fewer than 4 pages (about 1000 words). Your writeup is key. Oftentimes your grader cannot see what you’ve done unless you tell the grader. So “crow” about the compelling nature of your features, the elegance of your UI, and the power of your implementation.

[Amy says: if you have a hard time figuring out how to write something of use to another developer, imagine telling someone in section how to do what you did, or complaining to them about all the things you had to try before you hit upon the thing that worked. Especially where your code is a little hairy or obscure, you want to explain why you did it that way instead of some other way that the other developer thinks, on first glance, would have been better. If the actual reason you did something was “I didn’t have time to do this any other way,” that’s still valuable information to provide, as it allows the future developer to distinguish between necessary and unnecessary complexity in your code. If you do not point out unnecessary complexity in your code, we will assume that you did not notice it, and from a grading perspective it is worse to do something nasty and not notice it than it is to do it and admit it. (Of course, it may just make sense to point out nasty bits in inline comments; not everything deserves a mention in your writeup itself. The point is not to leave ugly or ’smelly’ code in your project and hope we won’t notice it.) Think of your writeup as writing the first part of a good story about your project. You want the reader (QA, potential users, future developers, etc.) to be engaged, informed, sympathetic, and eager to be involved in the work of adding on to the story.

You DON’T want to write a sentence, run a word count, write another sentence, run another word count, and so on until you reach John’s 1000 word floor. If you tend to save the writeup until the very end and then sit staring at a blank screen wondering what to say, try keeping a log while actually at work on the project: jot down problems you’re facing, decisions you come to and why, expressions of frustration, notes about how long something took you to do, resources you found helpful, etc. Then when you get to the writeup you will have a wealth of raw material to use.]

Required

First, you must implement the distribution of invitations by e-mail. Here’s what that entails:

In InvitationsController#create, you probably have a line something like this:

Invitation.create!(:invitee_id => id, :playdate_id => params[:invitation][:playdate_id], :viewed => false, :accepted => false)

In addition to this, you must send that person an invitation by e-mail. That mean sending a link. What kind of link? It might be something like the following:

http://localhost:3000/invitations/invite/341

where 341 is the id for the invitation. Let us say that invitation 341 is for john@7fff.com.

The recipient of the e-mail clicks on the link. Since there is no action for invite in InvitationsController, you will need to write one. I click on it. If I am not already logged in, I should be given an opportunity to log in. If I *am* logged in, the software should check to see if invitation 341 is really for me. If it isn’t, I should get an appropriate error message.

When an invitation is viewed, the “viewed” attribute should be changed to “true” in the database.

Then the template for the invite action should show me the details of the invitation, and I should be able to submit a form that means I am accepting the invitation. Note that you might choose not to blend into this form adding/removing children from the playdate (there is an existing UI for that).

The best implementations will do the following: They will allow the invitee to add/remove children when they accept the invitation. It should be possible to click the invite link twice, and something reasonable should happen the 2nd time (perhaps just a message saying that you’ve already accepted the invitation, if that is the case). It should be possible for a new user (someone who only has an e-mail defined in the users table, but not first name, last name, password, etc.) to provide more registration information. If you will recall, in the original model, we require new users to pay, so this would be when we would do that. [DO NOT TRY to implement e-commerce! If you like, you can pretend that it’s implemented with a checkbox that says that the new user agrees to pay.]

Extra credit for the required feature

For a couple of points extra: It is problematic that the id’s for the invitation links are in a known sequence. This means that someone could very easily guess what other invitation links are, and could create spurious “view” or “accept” values. Add a column that represents a “globally-unique identifier” (you should be able to Google for this to get some ideas; a synonym is UUID), and put that id on the invitation links. For example, here is a link we use at Duffy’s Cliff to confirm a user:

http://www.duffyscliff.com/account/verify_user/OEeaw-64kD4p5yqcfjn_-F1HPPg

By this means, it should be virtually impossible to fiddle with someone else’s link.

And Implement Two of the Following

After each feature, I will provide a bit in brackets that “scores” the feature in terms of difficulty, potential to learn, and value for the application (10 means high value, 1 means low value. E.g., “Difficulty: 3, Learning: 1, App: 10″ would mean not too difficult to implement, you wouldn’t learn a lot, but it would be a great feature for the user).

1. User management: Adapt the login / registration code to use the acts_as_authenticated plugin (http://agilewebdevelopment.com/plugins/acts_as_authenticated). You should provide a means for the user to fully register (adding first_name, last_name, etc.). You may use either the RESTful version or the non-RESTful (it is claimed that since Rails is going RESTful, using the RESTful version is more in keeping with Rails best practices, but it seems to me that the dust has not settled on this yet; so pick one and don’t worry excessively about your choice). The best implementations will build on acts_as_authenticated so that the user can register during the acceptance of an invitation. The best implementations will study the migration provided by acts_as_authenticated, and will figure out a way to save the existing user data as it is migrated to the new scheme. This may be hard.

[Difficulty: 5; Learning: 5; App: 7]

2. Ajax: Ajaxify as much as seems appropriate. The very best implementations would implement a number of the following:

  • Updating sections of the page as appropriate
  • Replacement of a form with the results of that form after posting
  • In-page asynchronous notification of events (e.g., “Naomi has accepted your invitation for the playdate on 26-Dec-2007″)

A possibly neat use of Ajax would be to modify the creation of an invitation so that when the user invites to a playdate (/invitations/new) the page would detect when the playdate drop-down is modified, and then indicate dynamically (through an update of a <div>) who is already invited, and/or who has already accepted.

Yet another cool effect is to accept the form for the addition of a playdate, and then update the table showing all of the playdates right in place, with the newly-added playdate. One neat thing people do with this kind of update is to use the “yellow fade” effect to highlight the playdate that has just been added (Google for yellow fade effect to learn more about this).

By all means, write e-mail to the course list if you have other ideas. Amy and I are not the biggest Ajax people, so we would likely learn from your ideas in this department.

The best implementations will also ensure that your app degrades gracefully for those users who have disabled javascript or may be accessing the app through a non-standard browser. Be sure to mention anything you do in this regard in your writeup. If you don’t ensure graceful degradation, your writeup should explain why you don’t think it’s important to do so in a way that your ‘product people’ will understand and agree with.

[Difficulty: 5; Learning: 5; App: 2]

3. REST. Provide a REST interface for at least one of the models. Location would be a good place to start. More ambitious would be to get the “schedule” listing, in some form. The best implementations will implement nested resources, so that one can say /users/5/playdates or /users/5/playdate/10 and so forth. The very, very best implementations will use the UUID idea (see above under the required e-mail feature) so that the user id is not given. E.g., /users/OEeaw-64kC1p5XBcfjn_-F1HPPg/playdates/12 — this way you have a certain measure of “security by obscurity”).

[Difficulty: 7; Learning: 7; App: 4]

4. Implement the answer you gave for the question in Assignment 4.

[Difficulty: 3; Learning: 2; App: ?]

5. Add the ability to upload photos of the users and children. Photos of children should only be viewable by other users whose children are participating in a playdate with the that child. You may use the strategy outlined in AWDR (pp. 501ff), or use the attachment_fu plugin. See this tutorial: http://clarkware.com/cgi/blosxom/2007/02/24#FileUploadFu

Tip: For attachment_fu, on Windows, use RMagick.

If you plan to do this feature, you should probably do it first, because it may turn out that the install of ImageMagick is problematic.

[Difficulty: 3; Learning: 2; App: 4]

6. Implement ratings

There are a lot of things worth “rating” in CCC. Users might rate playdates, locations, the organizer of the playdate . . . There are a lot of ways to do this. You might try to implement it with your own design, and if you have a good idea for it, try it. There is also a plugin: acts_as_rateable (http://agilewebdevelopment.com/plugins/acts_as_rateable). You may find that the plugin limits you. For example, if you have two children, should you get two votes? etc. If you find the plugin limiting, you may need to decide whether to continue using the plugin itself as-is, use it but extend it, or take the general idea of the plugin and implement your own version. Be sure to explain all the choices you made in the writeup. If you choose to extend the plugin, it will be especially important to point out the changes you’ve made in the writeup, because other rails developers will assume the standard plugin functionality unless told otherwise.

It might be interesting to blend this with the Ajax option, so that ratings are applied immediately when someone clicks on a list of stars or some such.

[Difficulty: 7 (to get it right); Learning: 2; App: 3]

7. Something else. You must get approval from your grader. The original deadline for this was Dec. 19, but if you discover something you really want to try, we will consider it, though our bias will be to say “no” at this late date. If you are adapting Assignment 5 for the final project, you may only use one self-defined feature.

[Difficulty: ?; Learning: ?; App: ?]

Great Panel!

Posted by john in Logistics, Announcements

Thanks everyone — panelists and students — for making yesterday evening’s event a success.

For those of you who couldn’t make it, here’s the design of the t-shirt I had made for the course:

norman_t2_final-600.jpg

If you come to one of our meetings on Jan. 8 or 16, you can pick one up (there are still a few in L and a few in XL).

The shirts were made by my good friends at The Red Seat, who design shirts and other goodies for Sox fans: Their merchandise uses no imagery licensed by MLB, so they’ve had to use a lot of creativity in their designs.

By the way, not everyone filled out the sheet, so I had to guess for the additional sizes. I think we ran out of the M’s. Sorry about that! But larger sizes are frequently ok in t-shirts . . .

Important announcement: Amy’s section tonight cancelled!

Posted by amy in Announcements

Hi Sectionites:
I apologize, but I will have to cancel section tonight, as I have a 100 degree fever and cannot walk. I will offer an online section tomorrow night instead.

Please email me and choose your preferred time, if you have a preference.:
thursday 5 pm
thursday 8 pm

If a huge number of you can’t make it at all on Thursday night, I could do a section over the weekend instead.

Amy

Decent book by Eldon Alameda: Practical Rails Projects

Posted by john in Ruby on Rails

I’ve been paging through a new book, Practical Rails Projects, by Eldon Alameda, and so far, I’m pretty impressed.

Here are some of the highlights so far:

Chapters 2, 4, and 5: Creating an “interesting” app, leveraging a similar knowledge base to what you are learning in this course. Going through these chapters could lock in what you’ve learned. One thing I like here is that he uses the standard vocabulary of Rails, and doesn’t slow down a whole lot: It’s pretty lean.

Chapter 3: Adapting the acts_as_authenticated plugin to an existing app.

Chapter 6: Adding a REST (web services) interface. Good discussion of using the curl application to test it. Up-to-date account of authentication issues with REST and acts_as_authenticated

Chapter 7: Adding graphics: charts and (my favorite) sparklines.

Then it really gets interesting, as there is a whole chapter studying the code organization of Typo (best blogging software for Rails, though abandoned by many because WordPress is so dominant with its useful plugins, mindshare, etc.).

All that is just in the first third of the book. I will likely review this on my blog in a few weeks; stay tuned. [Amazon]

Assignment 5 and Final Project

Posted by john in Announcements

Assignment 5 and the description of the Final Project are ready: http://e168f07.7fff.com/private/assignments/

A few highlights:

Due dates –

Dec. 9: Due date for final project proposal if not based on ChildCare Co-op. The instructions in the download provide information on this. The key is that your project should be similar in complexity to ChildCare Co-Op, and the proposal should be similar to the writeup for ChildCare Co-Op (http://e168f07.7fff.com/assignments/assignments-4-5-and-6-overview/).

Dec. 16: Due date for Assignment 5.

Dec. 19: Due date for an additional “feature” if you choose to extend ChildCare Co-op but want to do something besides the choices for additional features.

Jan. 19: Due date for final project. Super “drop dead” due date: Jan. 21. If for some reason you have thoughts of an extension, remember to review the rules for “EXT” grades, and keep in mind that there is a lot of red tape around dates, getting signatures, etc. (http://extension.harvard.edu/2007-08/register/policies/grades/)

For assignment 5, your task is to write some missing controller actions and make dynamic some views that are currently “static” (just raw HTML with canned non-dynamic data). There is a rather long discussion of all of the controllers and what needs to be done for each one.

In the e-mail to the group I included a URL to a “reference” implementation. I will provide that in lecture if for some reason you’re reading this but didn’t get the e-mail.

Note as well that I added some validations and convenience methods to the models, so you will probably want to use the ones that come with this download rather than relying on the models you created for Assignment 4.

The download also includes the way we wrote the original associations, as well as solutions for the finders. Note that the tests for many of the finders allow for multiple solutions, so in some cases you will see multiple solutions inside of an Array (in lib/finders.rb).

There will be a few tweaks forthcoming: A very few tests, and I want to fix the stylesheets for IE; otherwise, this is the blueprint for the rest of your work for the semester.

Enjoy!

Amy’s guide to plugins

Posted by john in Ruby on Rails

Folks,

Check out Amy’s guide to choosing and using plugins: http://www.thirdbit.net/articles/2007/11/19/amy’s-guide-to-choosing-and-using-rails-plugins-with-bonus-checklist/

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Login