Posts from (24)slash7...

RJS Demystified With Pretty Colors!

I probably should have spent the time today to fix the slash7 template, but my heart wasn't in it. My heart was, on the other hand, in this:

That's a screenshot of the second page of my first-ever multi-page cheat sheet, RJS Demystified. RJS Demystified is actually an entire 3 pages long, all in achingly saturated color. Well, except for that third page, which is mostly text.

Since I'm still in the process of buffing up the new Mephisto-powered site, let's keep this cheat sheet launch low-key. Feel free to pass it around to your friends and loved ones (or even your enemies, if you are so inclined), but please resist the urge to stick it on Digg or anything like that. I'm not ready to take another Digging just yet.

Ego Alert: And yes, I'm making the presumptuous assumption presumption that if it went onto Digg, it'd probably be pretty popular. You and I both know how those Diggers are about Ajax?like rabid bunnies.

Let me know what you think!

Saturday Post? Well, Maybe Not

So I didn't finish what I thought I'd finish today, owing to the fact that some of my friends came over to visit me. Yay!

But here's a little teaser:

Hold tight. It'll be comin' tomorrow.

Tags: happy_fun_notes, metablog

Converting to Mephisto - Almost Done

Dear readers,

As you can see, Slash7 is almost back to its former beautiful glory. Once I write some custom liquid plugins for Mephisto to handle the rest of the sidebar, and customize some section templates, it’ll be all the way better… and perhaps even better than before.

So you wanna be a convert…

If you’re curious about switching from Typo to Mephisto, there’s never been a better time. My conversion process was a little bit painful, but do-able. I found some bugs in the conversion scripts (so you don’t have to!), and Rick Olsen, being the world’s most generous and timely soul, fixed them right then so that I could enter the fold.

My suggestion for conversion goes something like this:

  1. Dump your Typo database using MySQL dump, or whatever tool your RBDMS of choice offers. For example, in MySQL, you would type: mysqldump -u username -ppassword typo_db_name > backup_file_name.sql.
  2. Get Mephisto, create a new database with your backup file (create the new database; load it up with mysql -u username -ppassword new_db_name < backup_file_name.sql).
  3. Set up Mephisto's database.yml file with the info to access new_db_name. Set it as the development environment DB.
  4. Go to Mephisto's directory and run the converters, like thus: script/runner "Mephisto.convert_from :typo" -e development
  5. Rename the default theme (in RAILS_ROOT/themes/) to site-1, because that seems to be the actual default theme name.
  6. When all this is done, start Mephisto up in development mode (preferrably using Mongrel)

Caveat: these steps are from memory. I should have written this down when I did it, but I was too busy doing it. Mea culpa But as long as you work off a copy of your database, you will be fine. At most, you lose a few hours of your life. Never, ever work off the live database.

Now you’ll have to work on your theme and whatnot… which is a whole ‘nother story.

In which the author offers temptation…

I’m also working on something secret and delicious which I shall be posting tomorrow. Indeed, on a Saturday.

Why Saturday posting? you might be asking. (I know you’re not actually thinking that at all, but play along with me for a moment. Please?)

In which the author whines about cruel Fate…

Well, remember how I wrote that I’d sprained both ankles in New York? This was strictly true, since I twisted them both and they both hurt, except that my left ankle was really only just a bit twingy. I’d been able to walk on it the entire time with only annoying discomfort (even though it was compensating for the right), and so on. By yesterday evening, I felt good enough to walk normally, and I noticed that the less I favored my more-sprained ankle, the better my whole body felt.

Apparently I was being premature, because in the parking lot of my local grocery store my left (barely sprained, all-better) ankle suddenly buckled under me and sent me careening towards the curb. Not only did I sprain my left ankle quite severely, but I banged up both my shins.

Now I really can’t walk at all, or get out of bed without help, or even straighten out my left foot. I thought the sprain I gave my right ankle last week was unpleasant, but this is a whole ‘nother ballpark.

At least this leaves me with lots of “sofa time” that I can use to be constructive.

Tags: articles, development, metablog, rails

OSCON 2006 Interface / UXP Presentations

I have two presentations at OSCON last Thursday, and as usual, I promised to post the slides. A little delayed, perhaps, but here they are. I recommend them in the order I list 'em... although there's no audio to accompany it, you can still probably glean some good infos!

Tags: talks, usability, web_design

Javascript Boot Camp Tutorial

On Monday I gave a 3-hour tutorial first thing in the morning, here at O'Reilly OSCON 2006 in Portland. From the description:

Even though AJAX wouldn't ever have become so popular if the Javascript world hadn't suddenly exploded with mature development and testing tools, there's little information on how to be a really good Javascript programmer.

This talk is for everyone who feels their Javascript skills just aren't up to snuff.

You can now download the goodies associated.

Shameless plug: I'm working on a book called Web Scripting Power Tools with Chris Cornutt, to be published by O'Reilly this fall. I'm apparently so bad at self-promotion that I forgot to mention it in my talk. Yow. But do watch for it! It's going to cover all that I talked about and much, much, much more. Interested in being on a notification list for this book? Drop me an email ( amy aht infocookie dawt com ).

Tags: talks, web2

More speaking announcementy things

Ah, another non-geek-writing update. Alas! Between family issues, changing jobs, working on my OSCON tutorials and flat-out baking in the mid-summer heat...

Oh, did I mention OSCON? I did not, before today, because I am a bad, bad blogger.

I'll be at OSCON next week, giving a Javascript tutorial and two regular sessions on user interface design for developers (When Interface Design Attacks! redone) and user experience. Of course, these things will be online not long after I actually give em, so even if you can't attend you can at least imagine.

I'll also be giving a micro-talk at FOSCON, which is a free (as in beer) event on Wednesday evening. FOSCON is all Ruby all the time. If you're in the area, please come!

You can berate me in person for not writing :) (I deserve it, I know.)

Tags: metablog

Quick Glimpse: Evolution of Humor

You may think I've forgotten about the article I promised about tech writing, but I'm still chugging away. I spent quite a bit of time on it today, actually. It just keeps getting bigger. I've decided I have to split it into two parts: what's wrong and why for part 1, and specific ideas for how to improve your writing for part 2.

To give you an idea of how large I'm talking, the first part's already 1600 words and still not complete, and I pulled some stuff out for the second part. The stuff I cut out comes to 650 words by itself. Perhaps I'm too ambitious. But I promise it'll get done soon.

In the mean time, I thought I'd share a little related tidbit that you writers and aspiring writers might find useful. I've begun writing an article about using Scriptaculous' drag & drop capabilities and I got the idea in my head that I'd track the progression of a single sentence to show a bit about my writing process. You can see how I may start with an ordinary textbook sentence, attempt to punch it up, try to capture the funny thing I'm thinking, and adjust the timing and whatnot to make it actually amusing.

Of course, I'm not a PhD in Funny so your actual laughter mileage may vary. YALMMV.

Tags: metablog

RailsConf 2006 Talk & Notes

Phew!

RailsConf is over. It was awesome and exhausting—from the late nights in the crummy hotel "bar" and agonizing over lackluster wireless, to the random accordian music, hilarious jokes, and pick-up games of Mario Kart DS. I met so many great people I can't even keep them straight in my memory. If we talked at RailsConf, please comment and say hi so I can have a link to your site (if you have it) or just a record of your name! And if I was doing my "can't keep them all straight" thing to you, please know it wasn't personal, the social parts of my brain have been just incredibly overloaded!

On Friday afternoon, I gave a talk called Overcoming Scaffolding Addiction. The basic premise: Scaffolding is a crutch, and if you continue to use it, you may never get past the hobbling stage. Throw away the scaffolding, and start a project from scratch. You'll learn more and your application design will probably fit your actual needs better. I then went on about how to start, trying to cram a bit too much into the 1-hour time frame. Ah well, live and learn.

You can download the slides (which are not entirely useful without my narration, but c'est la vie):

PDF (1.1MB)

Also, I told the people in my talk that I'd be putting up some more information on my site. For example, about my book.

Book Info Redux

I am writing a book called Ruby on Rails Right-Brained Guide for the Pragmatic Programmers. Basically, imagine my articles, but in book-length form! And with even more graphics.

I'll have a site up for it in a few days, where you'll be able to register your email or cell phone number (for SMS) to be notified when the book's available for purchase. Right now I'm hoping for a mid- to late fall release date and there are no plans to make it a beta book (although it will be available as a PDF).

Sidenote about a cool tool

Also, I didn't get a chance to cover script/console, but I really wanted to. For those of you who are working on your model associations, etc., try going to your Rails' app's folder and typing script/console. You can use it to manipulate models and see if the associations are working, test out your custom methods, or use it to learn the finer points of the finder methods. There's a lot more to this, and it's an article waiting to happen, but I just wanted to put it out there now for those of you who may never have heard of it.

Oof.

That's all for now. I'm still working on the article on tech writing. I got some done last night, actually, and borrowed Geoffrey Grosenbach's nice podcasting microphone to do a few experiments with audio recording. If I can find content that fits the audio format, I may be offering up some stuff soon that you can listen to instead of only read.

Tags: rails, talks, tips_and_tricks

RailsDay, RailsConf

RailsConf

I'm at RailsConf! If you see me, come over and say hi. I have green hair, and I'm female, so I'm easy to spot. Also, I've finally caved and uploaded a picture:

I've found that if I smile, I look drugged, and if I don't smile, I also looked drugged, so there you go!

RailsDay

Sorry for the suspense, but man can being up 41 hours wipe you out!

Here are some more screenshots from my RailsDay project, created with my longtime friend and Rails collaborator Bryan Wood:

And the previous sneak, we actually didn't get to fully implement. Darn you, time! But here's the Photoshop mockup in its entirety:

Note: Our application is viewable source, but not open source. You can download it, learn from it, tweak it, run it on your own computer, but our license doesn't allow you to reuse or redistribute chunks of its code or graphics, HTML, CSS, etc. We really wanted to participate but we didn't want to change our project to something we wouldn't mind see installed on a bunch of other people's web sites.

Tags: web_design

Sneak Peak for RailsDay

I'm still awake and still working.

Coming soon to a screen near you.

Tags: development, rails, web_design

Interested in learning to write better?

Hey Kids, It's Democratic Blog Time?!

I'm going through old posts that I started but never finished, or notes I made to myself to write about later, etc. The first one I'm thinking of tackling is an article about why most tech writing sucks and how to write better (a guide for geeks specifically). The existing content is stuff I tried to fit into Are Writers Better Women? Duh but it just didn't fit there.

Before I rip it apart and smush it back together in a form that's worth reading... is anyone interested? Please post a comment yea or nay, or hit me up on IRC, especially if you have any special requests.

Happy weekend!

Also, if you're participating in RailsDay 2006, good luck! And say hi if you drop into the RailsDay Campfire chat, because I'm competing, too.

Tags: happy_fun_notes, metablog

Workshop for Good Thoughts

It's been just over 4 weeks since Workshop for Good was wrapped up. I started to write a post about it at the time, but I just never got to finishing it. So here, with the added perspective of a month, is what I think and thought about Workshop for Good.

Written the day afterwards:

The only thing I can think right now about Workshop for Good is "OH GOD, it's over." This is a positive OH GOD—because boy, was it taxing—but also a sad OH GOD, because I met a lot of awesome people and working with Jeff and Ezra was great. It was exhausting, and stressful, but also wonderful. There haven't been a whole lot of things in my life that have been so much of both. I'm ready to do it again --- in, say, 3 months.

Things I learned, in short:

Most of you couldn't attend, but I'd like to give you a taste of what you might have learned if you'd attended. I can't cover all the Rails stuff in one post but I can cover one particular aspect. Specifically, since you're reading my blog, things you might have learned about me:

All in all, it was a great experiment --- and best yet, it was for charity. Since we held the workshop in the school, everyone (including Ezra and I) got to really see what we were doing to help out the kids. And the kids we did meet were great, despite the difficulty of their environment.

Having learned what I have learned, and met all the wonderful people I met, I'm hopeful that I'll get to do more training in the future. And if you're out there, guys, thank you again for being our gentle, willing guinea pigs, and for helping make an improvement in the lives of the teachers and students of Cesar Chavez.

Tags: happy_fun_notes

Because, Let's Face It, Webrick Sucks

My favorite new web server is a real dog. No, really. And it's no poncy purebred, either—it's a Mongrel.

Goodbye, Webrick

Webrick is the built-in Ruby web server that is the default for each Rails app you create or download—when you type script/server, that's what it's running, unless you've configured it otherwise.

It used to be that Webrick was the only suitable thing to run Rails in when you're development, and it required no configuration. Then people started using lighttpd even for development mode, because of Webrick's many flaws, but lighttpd isn't the easiest thing to get working. I, for example, gave up on it after a few hours because nobody could track down the error I was getting. Blow that for a lark, said I, I'd rather use crappy Webrick because at least it'll start.

But the problem with Webrick is not that it won't start, because it will start; the problem is that it's really, really slow. And not only slow, but buggy.

Development Mode is for Smart People, Not for Webrick

When you run a Rails app in development mode, it's supposed to reload every single Rails file every time it's called for—in production, it caches stuff like your model classes, and an internal representation of the database table attached to the model. This makes development mode slow by nature, but really great when you're actually working on an app. The point of development mode is that you don't have to restart your web server just because you added a column to one of your database tables.

In development mode, though, it's not at all uncommon for Webrick to not reload files it should, or check out the database again like it should. Not only does it get progressively slower with each reload! No, on top of that, many of us have pulled out hair trying to figure out how our change isn't working, only to find it's because Webrick's not behaving and it needed to be restarted.

Basically, it's a crappy experience. Fairly unRails-like, even.

Enter Mongrel

Mongrel is another lightweight web server for Ruby apps, much like Webrick. Except it doesn't suck. Mongrel is so fast that it's actually good for parsing Ruby apps (like, I dunno, Rails!) on production servers.

Let me repeat myself:

Mongrel is Fast!

And it's easy to install:

$ sudo gem install mongrel

And it's easy to run in the background:

$ cd myrailsapp $ mongrel_rails start -d

It's also easy to stop:

$ mongrel_rails stop

Or run with its logging to your terminal window:

$ mongrel_rails start

Mongrel also runs on port 3000 so your Rails app should be available at http://localhost:3000/ if it's running on your current machine.

Zed Shaw is My Hero

He may be grumpy, but he made Mongrel and so he's secured himself a special place in my heart.

Tags: development, rails, tips_and_tricks

Because, Let's Face It, Webrick Sucks

My favorite new web server is a real dog. No, really. And it's no poncy purebred, either—it's a Mongrel.

Goodbye, Webrick

Webrick is the built-in Ruby web server that is the default for each Rails app you create or download—when you type script/server, that's what it's running, unless you've configured it otherwise.

It used to be that Webrick was the only suitable thing to run Rails in when you're development, and it required no configuration. Then people started using lighttpd even for development mode, because of Webrick's many flaws, but lighttpd isn't the easiest thing to get working. I, for example, gave up on it after a few hours because nobody could track down the error I was getting. Blow that for a lark, said I, I'd rather use crappy Webrick because at least it'll start.

But the problem with Webrick is not that it won't start, because it will start; the problem is that it's really, really slow. And not only slow, but buggy.

Tags: development, rails, tips_and_tricks

Perfection Paralysis & The Joy of Little Posts

Oy!

So every time I sit down to write a blog entry, I'm questioning the relevancy of what I'm about to write—I want to serve you, my dear readers, and that's no joke (t-shirt- and coworker-pimping aside).

But I'm about to stop doing it.

I have recently realized that the more I restrain my fun little blather, the less I want to write, period, about any topic. They say the only way to have good ideas is to have lots of ideas, because ideas breed ideas. Apparently the same is true for the desire to write (and coming up with topics).

I've also realized I'm not helping anyone if I wait for ages to post any technical content because I want it to be a full-length, magazine-worthy article.

Tags: metablog

Meet My Coworkers in Dublin

There's some more Rails content coming, I promise, but I've been absolutely beat. However, I'm going to take a moment or two of your time and pimp my good friends and coworkers' talks in the lovely Dublin, Ireland (where I wish I was going!).

Well, actually, two coworkers and one boss. Or... well, I can't even keep track of people's job descriptions any more, but Chris Shiflett, Theo Schlossnagle, and Laura Thomson—my esteemed and brilliant colleagues—will all be at ApacheCon Europe this June, giving various tutorials (four between them). If you think I'm an overachiever, you obviously haven't met these folks.

The sessions are:

There are goodies in the mix: If you register for any of these tutorials by June 6, the early bird deadline, you'll get 3 free books:

For more information, see this handy dandy flier.

Tags: work

Quick T-shirt Update

I'm working on a post talking about my experience(s) at Workshop for Good, but I haven't finished it up just yet. But I did want to drop you all a line about the Cthulhu-isher t-shirts.

The real ones---all nice and screen printed---have arrived! Folks who have paid already, I'll be sending you yours in the next day or two. Folks who haven't ordered em, now's your chance. Supplies are limited and I probably won't make a reprint.

Real photo coming soon.

Also, for my friends in the UK, you can now make your orders. Thanks to Tobi of Shopify for taking care of that bug a few days ago (but I've been way too pressed for time to announce it til now).

Tags: metablog

Random Fulfillment of Lifelong Dreams

Well, I never have put up the tip jar I've been thinking about, because somehow it just seems a little low. But, I've always wanted to sell some t-shirts, committing my crazier moments to a lifetime of display on people's chests; it's always been a bit of a backburner dream for me. Now that Shopify's out there and working, I have absolutely no excuse not to do it.

So, I'm proud and slightly wary to introduce to you... the Cthulhu-isher, my very first shirt. At $18 a pop, it's not exactly Old Navy material, but I'm hoping the whopper of a pun will make up for it! Plus, you'll be helping your humble author fund future shirt projects (some even with a Ruby/Rails-related bent).

Tags: happy_fun_notes, metablog

Surviving a Digging and the Futility of Statistics

Well, the after-effects of the digg are dying down. I'm elated at the exposure—I certainly didn't expect it to snowball to the proportions that it did. And what proportions are those?, you might ask. Well, rather big ones, actually. What follows is a formidably long tale of intrigue, danger and, above all, lessons learned about the digg effect.

The Numbers

According to Mint, slash7 (all pages included) received 16,010 page views on Monday, when I released the Scriptaculous cheat sheet.

According to Webalizer, slash7 received 58,397.

And by now, 914 Diggs. I made number five on the front page for a while. I'm tickled pink to have finally graced the front page.



When Ruby Goes Rogue

My friend Davey and I spent a fair amount of time trying desperately to shore up the server's defenses against such an onslaught of traffic. Unfortunately, nothing really worked. Ruby and Apache conspired like fiends to dominate the CPUs— they ate up CPU cycles like Takeru Kobayashi at a hot dog-eating contest.

In the end, I had to resort to putting up a static HTML file describing the mayhem — no images, no CSS, just the static HTML and Mint Javascript file. We redirected the download link to a CORAL cache to offload the 70K-a-pop hit on the bandwidth.

By the evening, traffic had died down enough to restore Typo. It was a thrilling ride, but I'd have enjoyed it more if the rollercoaster had been equipped with seatbelts.

Why Ruby Goes Rogue

Now, I know that a Rails application can hold up to this kind of load, because we see it every day. But my Typo install didn't. I'm not going to point the finger at Typo because I suspect it was a combination of things, although I suspect Typo's "feature completeness" may have contributed to the problem.

For one, the server's a measly dual PIII—I don't complain, because I get free hosting with root access, provided by an old and dear friend (thanks, Davey!). But a dual PIII is hardly the height of technology; we could get 1U rack for $1200 that'd be well more than twice as fast.

Secondly, I can't seem to use page caching with Typo. Yes, I hear you heckling me back there. But when I turn on page caching, people can't leave comments. I get a bizarre error that I haven't been able to track down: an error about permission being denied. Sounds simple, right? But the file Rails allegedly can't access is a CSS stylesheet. The permissions on which are, shall we say, quite liberal.

And so we come to the point I can't avoid. Typo is a bit bloated. The bloat has made Typo run slower, and it's also made it harder to track down bugs. We all know and love Typo, but maybe it's time to stage an intervention.

Lessons Learned

Boy have I learned my lesson. You might learn from my pain, so here's what I've learned:

First, fix any errors that might cause your server to fall to its knees and beg for mercy before you submit a link to Digg.

Secondly, if your aspirations include regular Digging, you better invest in a real server instead of taking hand-outs, however tasty free lunches may be.

Thirdly, definitely suck up to your friend who helps you survive a Digging with all sorts of arcane Apache wrangling. He deserves it.

Fourthly... don't use Apache. I'm going to see if I can't jury rig Lighttpd up before I try any such thing again.

Fifthly. It may be time to roll your (my) own. It's not as if there isn't proof that you develop a reasonably functional blog in 15 minutes, or somethin'.

The Saga Continues...

The whole thing just keeps on going—the Scriptaculous cheat sheet post has gotten 23,476 page views according to Mint; Webalizer says 26,475 (a closer comparison, this time). Mint doesn't track files, but Webalizer says the cheat sheet itself was downloaded 11,373 times—and I have no way of tracking the downloads from the various mirrors that popped up, nor the HTTP redirection I had to set up to save the server from (more) spontaneous combustion.

All in all, I did 1.9GB of traffic in one day. Yesterday, I did 2GB of traffic.

The Futility of Statistics

But let's compare those numbers again, shall we?

MintWebalizer
Page Views (Monday)16,01058,397
Page Views (C.S. post)23,47626,475

Not a whole lot of synchronicity going on here.

Webalizer works like a typical 1990's-era traffic analyzer: it parses log files. It was also obviously designed by nerds. It's butt ugly and, frankly, it's clear nobody gave a moment's thought to good information design. If you want the wham, bam, thank you ma'am of web stats, then maybe Webalizer's for you.

Mint, on the other hand, is much more nuanced. For one, it works via a Javascript include file (and PHP). The Javascript fetches all sorts of information about the user's browser, and lets you see the information in a much more useful manner, indexed by page title instead of just URL, and letting you see which referrers went to what file on a limited basis. But it's got downfalls in its UI, too, in my opinion.

But Mint's main failing is that what makes it good also makes it bad: the Javascript. The file must be included by the user's browser to even record the hit so RSS feeds and file downloads are out. And, in non-ideal circumstances—when your server is begging for its mommy, say—server load may be so severe that the file isn't loaded. And of course, some people don't run with Javascript on, but that seems to be a small percentage of the population.

Look, I Can Do Basic Math!

Why the difference?

Well, there's the load problem that I described above. There's also the questionable nature of Webalizer's information. Like many old-school stats packages, it has some funny accounting. Webalizer does track hits separately from page views, but what does it consider a page?

I think it might be counting CSS files or Javascript "pages," seeing as it reports nearly four times as many page views (all pages) as Mint does for the Day of Reckoning—although when you look at the specific page URL in question the difference is only 3,000 or 12%. This might be explained if Webalizer is tracking non-HTML responses.

Another option is that the 12% stems from the time when the server was too overloaded to send all the little files associated with the page, like Mint's Javascript file. But that doesn't explain the quadrupling of overall page views for the day.

Maybe Mint was just letting me down. I don't know. Can't know, really. Those of us who are statistics mongers by nature, well, we just have to learn to live with the uncertainty. It's kind of zen, really.

As An Aside...

If you're out there looking for a good web app idea to execute in Ruby, allow me to suggest a log file parser that doesn't suck. You can't get more reliable than parsing log files, but the fact is every package I've seen that does it (including the $800-a-head Urchin) just plain bites it. That's why Mint ($30) is taking the world by storm, even though it's PHP, and relies on Javascript, and certainly has failings of its own.

Tags: metablog, rails

Oh, ATOM!

I've gotten several emails about my Atom feed being broken. Well, I read them all, but I haven't had the mental bandwidth to respond or really look into the matter. (Why the Atom interest all of a sudden? I'd never heard of this problem until a couple weeks ago.)

Which is just as well, because Sam Ruby beat me to it. He also noticed my Atom feed was broken, and *he* took the time to figure out why. Just goes to show, sometimes if you wait long enough somebody else will do your work for you! (Not actually a recommended course of behavior.)

In short: It's not my problem. How I do love that phrase! It's a bug in Builder, which has been fixed—but the fix hasn't propagated through to my Typo install as yet. And seeing as I haven't upgraded this server to 1.1, much less trunk, it may be a while.

Some kind soul emailed me what the specific source of the problem was—the & in my tips & tricks category. Til the issue is resolved, I've changed my category name. Sigh.

Tags: metablog, rails, tips_and_tricks
next page »