Lecture Notes, Wed Sept 24 Lecture
September 26, 2008 | Filed Under Amy's interpretive drawing lecture notes | Comments
Here are thumbnails of my lecture notes from Sept 24 class, wherein I compare the power of inject to a big fat epidural needle, illustrate the complexities of Ruby inheritance with monkey surgeons (yeah, I know it doesn’t look much like a monkey), list some real and imaginary Enumerable methods, admit to having completely forgotten about the splat operator, and accuse Perl hackers of not being able to handle the truth according to ruby. Click on them to see the full, fat, slow-to-load images in all their amateurish glory (okay, actually, you have to click twice, once to get the medium size, and again to get the full size. I don’t know why):
Oh, and a few thoughts/links:
monkey-patching: to monkey-patch is to yank open someone else’s class or module, dynamically, and change its behavior to suit yourself. The internets tell me that the word originates in the Python community, where the practice is frowned upon, but has been taken up enthusiastically by the ruby community (where an alternative term ‘duck-punching’, has not caught on), in which it is a way of life. if this is your first foray into dynamic languages with ample metaprogramming capabilities, the very idea of monkey-patching can seem like a violation of all that you know is right and good in the world. You wouldn’t be alone there. It certainly seemed that way to me, when I first came to Ruby from Java. In ruby, there’s really no way to protect your code from other people getting inside it and having their way with it. You can declare things private, sure, but there are ways around even that. Ruby is polymorphically perverse — a crazy coding free-for-all. Not to worry, kids, in practice it all works out. Okay, sometimes it can be infuriating to discover that one of your rails plugins is monkey-patching ActiveRecord in some sneaky and undocumented way that trips you up. Still, after experimenting with Ruby I really never wanted to return to the narrow, buttoned up, square world I came from. I was hooked. Your mileage may vary, of course.
a couple of posts from last year’s blog that are worth perusing about now:
bonus link: _why on the splat operator:
Mixed Video is available
September 25, 2008 | Filed Under Announcements | Comments
The mix of the video is available — I added a new “videos” page (like at top) with the links.
Students who do (and don’t) get versions.rb:33:in “’: Exec format error - gem list (Errno::ENOEXEC)
September 25, 2008 | Filed Under Uncategorized | Comments
On Windows: I would like someone who DOES and someone who DOESN’T get this error:
versions.rb:33:in “’: Exec format error - gem list (Errno::ENOEXEC)
when running the versions.rb program . . .
I’d like to see the results of two commands:
assoc .bat
ftype batfile
Thanks. Add your results to the comments for this very post.
Lecture 2 slides
September 25, 2008 | Filed Under Uncategorized | Comments
I’ve posted slides for Lecture 2 in the downloads area.
Note: Firefox only!
On occasion the code examples will not load, or the code will appear on the wrong slide. If this happens, close your browser and re-open the file; sometimes reload doesn’t work.
If you want to see how the slides work, browse around in the “support” directory.
How’s it going on Assignment 0?
September 22, 2008 | Filed Under Uncategorized | Comments
Info on “Tips” page regarding screen-sharing (Elluminate)
September 22, 2008 | Filed Under Uncategorized | Comments
I have provided a few notes on screen-sharing on the “Tips” page; there is also a link there that shows screenshots of the install process.
Assignment 0: Due Sep. 28 not Oct. 5
September 21, 2008 | Filed Under Announcements | Comments
Folks,
Assignment 0 — system setup — is actually due at the end of the week, on Sep. 28, not Oct. 5. Oct. 5 is the due date for Assignment 1, the Ruby One-Liners.
Owing to the fact that this is my error, we will accept late submissions of Assignment 0; since Assignment 1 depends on Ruby being set up, you need to get 0 done before 1. But, truly, you want to get this out of the way ASAP, anyway. If your system is still not set up and you’re in the local area, and you’re on a laptop, bring your system to section. Otherwise send an e-mail to your TA. You can’t do Assignment 1 without Ruby and irb, at the very least, working.
In the majority of cases, this should be a pretty easy setup. I have seen some comments on the page for Assignment 0 about various issues getting the “gem list” to show: It is entirely ok to run that command from the command-line and simply paste into your e-mail the list of local gems. Basically we just need some assurance that getting the right versions of Mongrel, the Sqlite3 gem, etc., etc., are in the past so that we don’t have to deal with it going forward. In other words, Assignment 0 is all about getting certain issues off of the table so that we can focus on what really counts: Ruby and Rails.
As I hope you’ve noticed, for the sometimes harder case, Windows, I have posted screencasts of system setup. I am willing to do screencasts for OS X as well, if there is interest.
John
Section switching
September 21, 2008 | Filed Under Announcements | Comments
Those of you who have requested to switch sections: This morning I
will be working on making those switches where possible. If you
requested to switch sections and have not heard from me about it by 5
pm today, please assume that your request went to /dev/null and needs
to be re-sent.
If you have serious issues with your assigned section and haven’t yet
told me about them — speak now.
Section Assigments Delivered by E-mail
September 20, 2008 | Filed Under Announcements | Comments
Folks,
Amy send out the section assignments to the official e-mail addresses we have for you from Harvard; so check that e-mail address.
If you haven’t received an e-mail regarding section, e-mail Amy at amy dot newell at gmail dot com
Thanks.
ZIP for Assignment 1
September 20, 2008 | Filed Under Announcements | Comments
The ZIP for Assignment 1 is available on the “Downloads” page. Also, if you’ve already looked at the writeup for Assignment 1, you should review it again because I made some small tweaks.