7 Posts for October 2007

Trying Out wmii

Posted October 28, 2007

Wow, I’ve been busy. I just had my math midterm, not to mention the first rehearsal for the play I’m directing.

I did manage to find time on Friday to go on a little adventure, though. Ever since I moved to Linux, I’ve been finding more and more that I like a certain kind of tool. Emacs, for example. It may be complicated and have a steep learning curve, but the power it offers is almost unparalleled.

LaTeX, too. Sure it was kind of a pain to learn, but my math is so beautiful. And it’s so easy to write, now that I (mostly) know how.

I’ll save the rest of my lecture on UI for another post, but suffice it to say that I seem to like tools that have a steep learning curve but are very worth it in terms of power and productivity. Tools that aren’t built for everyone.

More make_resourceful Delays - Sorry!

Posted October 20, 2007

So it’s October 20th. Definitely past mid-October. And still no make_resourceful 0.2.0.

Yeah. Sorry about that. I’ve been busy. I haven’t even made a blog post in a week, and I can almost always find time for that.

It’s gonna take more time, I’m sorry to say. Hopefully it’ll be ready sometime in November.

Emacs
Tags

Making the Most of the Region

Posted October 13, 2007

One of the most useful abstractions Emacs has to offer is the “region.” The region refers to the characters between the “point” and the “mark.” I know, I know, more vocabulary. But these ones are simple.

The point is the place in the document at which you enter text. It’s usually shown as a little flashy box thing. When you type, the characters are inserted right before the point.

The mark is just a place in the text. There’s nothing inherently special about it, which is what makes it so useful.

Becoming a Blockhead

Posted October 12, 2007

About a week ago, I tried my best to explain the ins and outs of blocks in Ruby. The basic gist was that blocks were snazzy syntax for anonymous functions.

So what makes blocks so cool? This time I want to take a look at a few of the uses blocks are put to in Ruby.

What’s more, we’re going to define all the functions we use that take blocks ourselves. Most of the functions we’ll define exist already in the standard Ruby implementation, but hopefully by seeing them defined first-hand, you’ll get a better understanding of why blocks are so useful.

Before we begin, here’s something snazzy about Ruby you might not have known. We’ll be making use of it in all of the examples. You can take a preexisting class, like Array, and add methods to it whenever you want. You can even override existing methods.

Blog, Rails, Ruby
Tags

I've Been Podcasted!

Posted October 9, 2007

So, who knew the Rails Envy folks had podcast? Not many of you? Well, that’s not surprising, ‘cause the first episode only came out a week ago. But just like everything else they do, it’s pretty awesome and you should check it out.

Why am I mentioning this? Well, their second episode came out today, and in it they mentioned my article on Ruby blocks. I’ve never been podcasted1 before, so I thought that was pretty cool. I feel like I should do what I can to point people at their podcast, so… here we are.

1 I think this is the proper term…

Blog
Tags

More Spam Protection

Posted October 7, 2007

I have, once again, modified the spam protection for this blog. Akismet was letting an unpleasant amount of spam through. Not a lot, but enough to force me to SSH to the server to clean it up every week or so.

All I’ve done this time is layering a simple not-real-people weeder on top of Akismet. There’s now an extra form field in the comment form, but one that is hidden from you folks via CSS.

The idea is that only a spambot would fill out the field (craftily labeled “email”). I’ve added code on the server to flag any comment submitted with the fake field filled out as spam. Assuming everyone uses CSS-capable browsers, only spambots should fill it out.

Building Blocks in Ruby

Posted October 4, 2007

One of the things that most often seems to trip up new Ruby coders is the idea of blocks. Linguistically, they’re a pretty unique feature; I think Smalltalk is the only other language that has them.

They’re also similar to to functional constructs, but distinct enough to be a bit confusing on the surface. In addition, a lot of new folks coming to Ruby are probably used to languages even less functional.

So, in this post, I want to try to help clear this up. Blocks are actually really simple, but I think it helps to understand why blocks exist. To do this, I’m going to use a not-ruby language with not-blocks: Javascript.