Delicious Links – 20 links – blogging, windows, codinghorror, amazon, shopping

This is my weekly collection of the best stuff I saw on the Internet. You can follow this list of links as I post them on Friend Feed or on Twitter. Or you can get the weekly update by subscribing to Internet Duct Tape using RSS or using email.
- [AMAZON] Amazon Discounts: Secret Amazon Discount Finder, deallocker.com
- Cool tool for finding discounted items at Amazon. Works in Canada. Also has a coupon blog.
- [AMAZON] Top 10 Amazon Power Shopper Tools, lifehacker.com
- If you’ve ever shopped on the Internet, then you’ve used Amazon. Here are ten tips to help you use amazon from building wishlists to finding discounts/free shipping/coupons to getting refunds for items you’ve bought.
- [BLOGGER] Jerry Springer For Programmers: Only A Matter Of Time, gilesbowkett.blogspot.com
- From the article: ” It’s awesome to get a free burrito every 11,429 times somebody decides to read your blog. But that awesomeness doesn’t translate well to full-time careers.”
- [BLOGGING] More Bloggers Raising Money. Here Come The Politics. And Here Comes My Rant., techcrunch.com
- Arrlington on the business of blogging. Very honest.
- [BLOGGING] The Art Of Heresy (Or How To Thrive Under The Benevolent Rulership Of King Gabe Rivera), chartreuse.wordpress.com
- From the article: ” If your audience can view you anytime, anywhere then you have to be good all the time.”
- [CODE] Forced To Write English Syntax Code – Simplicity or Burden?, codesqueeze.com
- How being forced to write code in English makes things simpler for non-North Americans. You almost have to appreciate the strength of his opinion about the French…
- [CODE] The Programming Style that Saved my Marriage, ourdoings.com
- Programmers get grumpy when interrupted. Functional programming is a style that handles interruptions better than procedural programming
- [COPYRIGHT] Free your mind, stevenpoole.net, via:codinghorror.com
- Copyright should be renamed to RightToEat.
- [FACEBOOK] Facebook knows who you are, and that’s worth more than you think, paulbuchheit.blogspot.com
- If you don’t think Facebook is going to be a profitable company, then you’re underestimating the value of identity.
- [FLICKR] The definitive collection of Flickr tools, plugins and API applications, flickrbits.com
- Huge list of tools for working with Flickr
- [GAMERS] Grand Theft Auto IV Activity Book For Kids, the-minusworld.com
- And they thought Mass Effect was bad…
- [GEEK] stackoverflow, stackoverflow.com
- New podcast by Jeff “Coding Horror” Atwood and Joel Spolsky FTW
- [PHP] Rails for PHP Developers, railsforphp.com
- Great idea – it looks like the PHP reference, but it shows you how to do the same task in Ruby.
- [SCREENSCRAPING] Automating Firefox for Web Application Integration, urbanhonking.com
- Controlling Firefox using Ruby with the JSSH extension for screen scraping Javascript.
- [TWITTER] Shout about the best of Houston at PlaceShout, blogs.chron.com
- Interesting, like Twitter but for location. A bit rough around the edges, needs to support non-US zip codes.
- [WEB2.0] The noise in Web 2.0 is mainly a Tech Elite problem, vanelsas.wordpress.com
- Real people don’t suffer from information overload because they can walk away from the computer.
- [WEBDEV] Web pages have ‘come alive and started breeding’, telegraph.co.uk, via:gilesbowkett.blogspot.com
- Interesting idea: the design of the web page evolves based on how people interact with it.
- [WINDOWS] Tray It, teamcti.com
- Great little free windows application that lets you minimize ANY software in the system tray.
- [WINDOWS] Upgrading from Vista to Windows XP: A Review, dotnet.org.za
- Worth reading :)
- [ZUNE] 5 reasons my Zune is dead to me, crave.cnet.com, via:raganwald.com
- Remember the Zune? Me neither.
How to delete your Tumblr tumblelog with TumblrCleanr

Tumblr is rapidly becoming my favorite free blogging platform (more so than Blogger/WordPress.com) because of all the things they do correct:
- RSS feed importing (up to 5)
- free domain name support
- free CSS/theme support
- Google Analytics support
- javascript widget support
- keeping it simple
(You can read more about Tumblr’s Pro and Cons in this post I wrote for Lorelle on WordPress)
However, there’s one feature that’s missing: how do you delete your Tumblr? At some point you might want to destroy all traces of your tumblr (privacy concerns, or you want to use it for something else) and there isn’t an option to do that — other than click the delete button on every individual post. I wanted to repurpose a tumblr I had been using for feed aggregation and it had over 18,000 posts. That’s a lot of clicks.
Enter the TumblrCleanr. Provide it with your tumblr domain name as well as your username and password and it will delete up to the latest 3000 posts at a time. You can keep running it until your entire tumblr is clean as a whistle.
This script will DELETE ALL POSTS ON YOUR TUMBLR WITH NO BACKUPS. If that isn’t what you want to do then please don’t use it. :)
Delicious Links – 20 links – blogging, programming, ruby, photography, copyright

This is my weekly collection of the best stuff I saw on the Internet. They’re saved on delicious and stumbleupon and cross-posted to Twitter and Tumblr as they happen and then collected together for my blog on Internet Duct Tape.
Subscribe to Internet Duct Tape using RSS or using email.
- [BLOGGING] Feel Free to Steal My Content, zenhabits.net
- ZenHabits goes open source
- [BLOGGING] My next book: the story of blogs, wordyard.com
- Scott Rosenberg’s next book is the history of blogs
- [BLOGGING] What Are Your Anti-Memes?, smoothspan.wordpress.com
- Some thoughts on the type of articles one of my fav tech bloggers usually skips over.
- [CODE] Let The System Design Itself, gilesbowkett.blogspot.com
- From the article: ” 1) runs all the tests, 2) contains no duplication, 3) expresses every idea you want to express, 4) minimal number of classes and methods. When you work with these rules, you pay attention only to micro-design matters.”
- [CODE] Rich Programmer Food, steve-yegge.blogspot.com, via:news.ycombinator.com
- Why programmers need to know how to write a compiler. I really enjoyed reading this one.
- [CODE] Valued Lessons: Garlic Programmers for Silver Code?, valuedlessons.com, via:news.ycombinator.com
- How can you measure programmer productivity when the biggest factor is the code base they are working on?
- [COMMENTS] Reading Apptitude Questions rather than Captcha, lemurcatta.org
- Interesting idea: prove that the reader read the article before posting a comment.
- [GAMERS] 18 Undiscovered Websites Every Gamer Should Know, dailybits.com
- Some cool stuff in there, like the indie game awards
- [LIFEHACKS] Let Me Save You $40: Here’s How to Be Happy, enfranchisedmind.com, via:codinghorror.com
- 7 things you can change about your outlook to life that will greatly improve your enjoyment of it.
- [LIFEHACKS] New RescueTime Goals and Alerts Actually Helps Rescue your Time, blog.rescuetime.com
- RescueTime now has goal tracking so you can limit yourself to checking feeds for only three hours a week, for example.
- [LIFEHACKS] The Five Browser Shortcuts Everyone Should Know, codinghorror.com
- Have a better experience surfing the web with these shortcuts. There were a few I didn’t know.we
- [MEDIA] What My Kids Tell Me About The Future of Media, avc.blogs.com
- A look at how children consume mass media
- [PHOTOS] A Savvy Approach to Copyright Messaging, powazek.com
- Cool trick to add copyright notices to your photos without having to worry about people seeing them unless they’re trying to copy them.
- [PHOTOS] Namexif (Rename EXIF Photos), digicamsoft.com, via:noheat.com
- Rename your photos by date. Uses the info from your camera rather than the file date.
- [RAILS] 10 Alternative Ruby Web Frameworks, rbazinet.wordpress.com, via:lazycoder.com
- [RAILS] How to ruin a Rails project, dataconstellation.com, via:labnotes.org
- How many of these have you done?
- [RAILS] Ruby on Rails Handbook, railshandbook.com, via:virtualhosting.com
- Tons of cheatsheets and tutorials
- [RUBY] TreeTop, treetop.rubyforge.org, via:blog.zenspider.com
- ruby extension to make it easy to create new expression grammars
- [WORDPRESS] WordPress Plugin: Socialize Me!, blahblahtech.com, via:dailyblogtips.com
- When people come to your blog via a social bookmarking site, it will welcome them and prompt them to add you as a friend.
- [WRITING] That to This, randsinrepose.com
- 10 tips Rands learned that made him a better writer
- Powered by Delicious Links Pro
This Week at Internet Duct Tape
Internet Duct Tape is my blog where I talk about software, technology, blogging and other geeky subjects.
- Year in Review – Most Popular Posts of 2007
- Year in Review
- My Favorite Albums of 2007
- New Year’s Resolutions for 2008: release my “Best of” lists in the beginning of January, not at the end of January.
- Yahoo Pipe: Sub-Reddit Feed Filter
- Popular social bookmarking site Reddit has announced a great new feature: users can create their own sub-reddit. What does this mean in English? Users and communities can create their own social bookmarking sites around specific topics: blogging, wordpress, specific programming languages, etc but…
- How to Play Downloaded Videos on Your iPod, Xbox 360, or DVD Player
- I’ve been slumming through the support forums at answers.yahoo.com lately and this is a question I see come up often: how do I download a video and put it on my electronic device? More and more consumer electronics devices that can play videos, but that means we have to learn more about the big,…
- Delicious Links – 20 links – writing, programming, javascript, jquery, testing
- Tags: javascript, jquery, programming, writing
This Week at IDT Labs
IDT Labs is where I announce new software I’m working on.
- [PIPES] Filtered Technorati Recent Mentions
My Filtered Technorati Recent Mentions pipe works again. It can give you an RSS feed of the latest blogs that links to your blog. - [GREASEMONKEY] Userscripts.org Popular Scripts v0.2
Updated my script for identifying the most popular Greasemonkey scripts on userscripts.org
Tags: blogging, copyright, lifehacks, photography, productivity, programming, ruby, rubyonrails
Yahoo Pipe: Sub-Reddit Feed Filter

Popular social bookmarking site Reddit has announced a great new feature: users can create their own sub-reddit. What does this mean in English? Users and communities can create their own social bookmarking sites around specific topics: blogging, wordpress, specific programming languages, etc but still use their regular reddit account for submitting links and voting.
You can see a full list of all the new reddits here, sorted by popularity. Of particular interest to me is the new Reddit created for Ruby/Rails related posts.
Of course, it’d be nice to be able to subscribe to a filtered version of these links. I’ve created a modified version of Dave S‘s “reddit popular on delicious” Yahoo Pipe that works with Sub-reddits.
http://pipes.yahoo.com/engtech/subredditpopularondelicious
- Click on the link
- Enter the name of the sub-reddit you’re interested in
- ie: ruby, see full list of all the new reddits here
- Enter the minimum number of saves on a delicious before a link is included in the feed
- Enter keyword inclusion/exclusion filters if you want to limit what you get
- ie: include only rails-related posts or exclude all rails-related posts
- Click Run
- Click on the subscribe to RSS button
I’m using the Ruby sub-reddit as an example, but this is a great way to track links based around any topic there is a sub-reddit for. Even lolcats.
I’m looking forward to when this Reddit feature comes out of beta and it’s possible to create a few new sub-reddits like blogging, wordpress and lifehacks.
Related Posts
Why Open Source Software Sucks – Software Simplicity Isn’t Simple

Aside: Hosted software would be something like Gmail, while installable software would be something like Outlook. WordPress.com is hosted software by Automattic, but it is also available at WordPress.org where you can download it and install it yourself where ever you want.
There are a few “internet rockstars” in programming circles, and most programmers who read blogs will have heard of Joel Spolsky (one of the few people who writes entertaining tech books) and 37signals (the guys who made Ruby on Rails and Basecamp). The guys at 37signals recently wrote a post about how they prefer creating web-based software that they host vs software that a user would have to download and install themselves because it is so much easier for the software developer. When you don’t have to release your software into the wild you have so many less things to worry about: different operating systems, memory performance, installation dependencies, hardware dependencies.
“You have to deal with endless operating environment variations that are out of your control. When something goes wrong it’s a lot harder to figure out why if you aren’t in control of the OS or the third party software or hardware that may be interfering with the install, upgrade, or general performance of your product. This is even more complicated with remote server installs when there may be different versions of Ruby, Rails, MYSQL, etc. at play.”
Joel looks at his stats and points out that if he didn’t provide installable software then he’d be out of business, because it accounts for 80% of his revenue compared to hosted software. He also makes a great point that software that people are willing to buy is software that solves a gnarly problem, IE: it deals with complicated stuff. Any other kind of problem can be solved by free software because its uncomplicated enough that one guy in his mom’s basement can churn it out over a weekend.
“The one thing that so many of today’s cute startups have in common is that all they have is a simple little Ruby-on-Rails Ajax site that has no barriers to entry and doesn’t solve any gnarly problems. So many of these companies feel insubstantial and fluffy, because, out of necessity (the whole company is three kids and an iguana), they haven’t solved anything difficult yet. Until they do, they won’t be solving problems for people. People pay for solutions to their problems.”
But he then follows through with a great point that the gnarly problem that 37signals’ applications solve is the problem of design. 37signals might be building fluffy Ruby-on-Rails Ajax sites, but that’s beside the point of the problem they’re really solving: how to design a great looking user experience that makes people happy.
I think this draws a great parallel to what’s wrong with free software: it’s created to scratch a certain itch, and that’s usually all it does. Compelling user interface? Joy to use? Nope, it solves the original programmer’s problem and that’s about it. And before you get all uppity that I’m attacking open source software, let me clarify that I’m talking about the open source software I create.
The problem is two-fold: I have a natural tendency to over-complicate things and I have trouble sharing the customer’s pain (stepping away from the code, and seeing how a stranger would view the end result). Jeff “Metal” Atwood asks “When was the last time you even met a customer, much less tried to talk to them about a problem they’re having with your website or software?”
This hit me last week when I sat down with another engineer to show him an internal tool I was building for him. He started poking a usage case that confused him. It wasn’t in the spec, and it didn’t follow the way he thought of the flow. It was an artifact of the internal data structures I was using that I was exposing to the user. This happens too often. It’s the opposite of opinionated software [1]: pushing the decision making on to the user. [2]
Of course, writing open source software has its benefits because quite often there’s no barrier between you and the people who are using your software other than computer screens. You are your own quality assurance, and you are your own customer service. You have to explain to the users why they should install your software, you have to deal with the installation headaches your platform choice created, you have to explain any complexities with how to use it, and you have to help them when problems occur.
My open source software might suck, but its helping me explore the solution to a gnarly problem: how to solve problems in a way that is easy for other people to use.
Related Posts
- Getting to Simple – Engineers Have No Idea How Normal Human Beings Interact With Their Environments
- The Missing Curriculum for Programmers and High Tech Workers
- How to be a Programmer with 10 Simple Books
Footnotes
1 – There’s an interested essay to be written comparing opinionated software to considerate software.
2 – This programming talk might bore you, but the problem of simplicity in design is cross-discipline and applies to any blogger.
Getting Started with Ruby on Rails – Week 3 – Testing

I’ve fallen for the hype and started using Ruby on Rails for building database driven web applications. You can follow along with my weekly experience discovering gotchas with Ruby on Rails.
Previously: Getting Started With Ruby on Rails – Week 2
(I swear, back to your regularly scheduled non-rails content soon enough)
Gotcha #1 – after_initialized is after_instantiated
Yes, after_initialized is called more often than just when you call Model.new. Use if new_record? inside of it.
Gotcha #2 – button_to has it’s own class
You can’t pass :class parameters to the button_to helper because it creates it’s own :class=>”button_to”. Use :id instead.
Use console
script/console will give you an interactive console for playing with objects. Use it! It makes debugging tiny little gotchas with ruby syntax you might not be familiar with so much easier. Type reload! in the console to reload your models after any changes you’ve made. Type object.methods to see a list of everything an object responds to.
You can use many familiar console navigation keys like Up, Down to move between previous commands and Ctrl-A for start of line and Ctrl-E for end of line.
The Migration Shuffle
When you’re building a new migration on your development database always do the following:
rake db:migrate
rake db:migrate VERSION={current version - 1}
rake db:migrate
It’ll let you know that you’ve made an error in your down method right away, instead of weeks later when you’re trying to rebuild the database.
Little Bobby Tables
At some point your going to write a bad migration and screw up your development database, so rebuild it.
> mysql -u root -p drop database proj_development; drop database proj_test; create database proj_development; create database proj_test; quit
> rake db:test:prepare
> rake db:migrate

Data Migrations
If you’re building data migrations, always uses .save! so that it will fail on a validation error and you may want to litter your migration with puts statements to jump to which object is failing validation. There’s probably a better way of doing this using fixtures, or using –trace to find which migration failed.
Or hell, don’t use a data migration for bulky legacy data.
There’s Something About Tests
I really like how simple it is to write fairly complicated tests. One thing I didn’t like was how many tests it is possible to write. The examples from Agile Web Development with Rails showed them creating a lot of tests for the validates_* helpers. Unfortunately, you don’t need to create tests that duplicate those helpers because they are bulletproof. You do however need tests to prove that you used them correctly.
Cut-and-paste errors do happen, and double checking my validations did reveal at least one case where I thought I was validating a field but I wasn’t. Not to mention that if you’re using a regular expression filter to validate the format of a field you might forget to put start and end delimiters on it. Even testing something simple like all values are in the list is useful because you might have another validation that invalidates one of the values from your list.
Ruby is Dynamic
One thing I can’t stress enough is how much you NEED unit tests. Ruby is a dynamic language, and as such there isn’t a great and easy way to find out if the code will blow up without running it. If you run it by hand you won’t find all the interesting scenarios for the simple reason that you won’t be rechecking features you implemented last week that exploded because of a change you made this morning. You need a regressable test suite.
And there’s nothing like writing a test to make you realize how much more complicated you’ve made things than they need to be.
How to Run Tests
Run an individual test
ruby test/unit/testname.rb
Run multiple tests:
rake test # run all test rake test:unit # run unit tests etc
They can all be done inside of emacs by using the Tests drop down menu in rails-mode. This is the preferred method because you can click on errors and go directly to that file.
rails-mode also lets you use C-c C-c . to run the current test file. This allows you to rapidly iterate through test development.
Running Tests – Verbose Assertions
Here’s another tip that I didn’t realize at first: you can supply a message argument to your assertions that will display when it fails. This is essential if your using loops in your tests, IE: looping over an array of invalid field values, because the line number isn’t enough information to find out why the test failed.
Debugging a Test – Breakpoint
You can use the breakpoint keyword where a test is failing. This will open up a console at the breakpoint spot. Unfortunately it doesn’t work well inside of emacs because the ROutput buffer is read only (in fact, you’ll have to kill the process). So run the test from the command line when you want to play with breakpoints. I can’t seem to find a way to access the local variables in a method… so on to ruby-debug.
Debugging a Test – rdebug (or redbug according to Microsoft Word)
sudo gem install rdebug -y
in config/environments/test.rb
require 'ruby-debug'
Then use the debugger keyword instead of the breakpoint keyword where you want to stop. Don’t use it when you’re running tests from emacs because things will look weird.
Running Tests – Fixtures – Validating Fixtures
Here’s the fun bit: sometimes you break your fixtures. Not on purpose, to test bad data, but because your erb goes a little wrong, or because they’ve gotten out of date with your schema. Here’s a rake task that will let you do rake db:fixtures:validate
If you are using erb to generate your fixtures, you can also see how your fixture will roll out using:
erb test/fixtures/fixturename.yml
And while you’re at it, you probably want to validate your existing database against your models. Here’s a rake task that will let you do rake db:validate_models
Running Tests – Advanced – autotest (part of ZenTest)
There’s a plugin called autotest that will automatically run tests on any files that have changed. This is great because you can keep the console open in the background and it will immediately catch if you’ve saved a file with a typo! No need to go to the web browser, navigate to the changed page and hit refresh. In fact, using the web browser should be an afterthought… you should be able to create tests for any features.
sudo gem install ZenTest rehash autotest -rails
One gotcha: disable autotest if you’re manually running tests as well! You’ll end up creating duplicate records in the test database. The solution is: don’t manually run tests with rake at the same time as autotest.
Walkthrough of autotest: http://maintainable.com/articles/dry_up_testing_with_autotest
There’s a way to integrate autotest into emacs.
Running Tests – Advanced – RedGreen (for autotest)
Not the horrible Canadian TV show, but a notifier for autotest status reports.
https://wiki.csuchico.edu/confluence/display/webd/Testing+Rails+Apps
Running Tests – Advanced – ZenTest
ZenTest is useful for parsing your rail files and creating stubs of tests.
Running Tests – Advanced – Test::Rails (part of ZenTest)
Test::Rails provides a mechanism for splitting functional tests into controller tests and view tests. This decoupled lets you check your business logic as is, and your view routing as is.
If you want to add a generator for creating view/integration/controller tests:
./script/plugin install http://topfunky.net/svn/plugins/vic_tests
Some collected thoughts about Test::Rails
- Assertion Cheatsheet
- http://www.linuxjournal.com/article/7776
- http://blog.michaeltrier.com/2007/3/17/working-with-test-rails
- http://tuples.us/2007/06/03/fragility-of-view-tests/
Running Tests – Advanced – Rcov
Rcov is another tool that will help your testing by calculating the code coverage of your tests. This is an essential tool to find holes in your testing strategy. All the usual caveats of code coverage apply.
http://eigenclass.org/hiki.rb?rcov
sudo gem install rcov rehash rcov test/path_to_specific_test.rb - or - ./script/plugin install http://svn.codahale.com/rails_rcov
Now you can do
rake test:units:rcov
http://agilewebdevelopment.com/plugins/rails_rcov
Running Tests – Advanced – Heckle
Heckle mutates your code to see if the tests actually check anything. Unfortunately highly coupled code is heckle-proof because changing anything breaks everything else.
sudo gem install heckle
Running Tests – Measuring – Flog
Flog measures reports a score based on how complex it thinks your code is. The higher the score, the higher the chance that there is a bug hiding there.
sudo gem install flog
A Handful of Blogs About Rails Testing
These guys have written a lot (all?) of the plugins I’ve mentioned and are worth checking out if this stuff interests you:
Related Posts
Getting Started With Ruby on Rails – Week 2

I’ve fallen for the hype and started using Ruby on Rails for building database driven web applications. You can follow along with my weekly experience discovering gotchas with Ruby on Rails.
Previously: Getting Started With Ruby on Rails – Week 1
Emacs Rails-mode
Last week I complained about wasting time setting up rails-mode in emacs. I’m starting to find some real time saver though. The navigation short-cuts are absolutely necessary for navigating the file structure of a Rails application and I really like how the syntax highlighting can capture lines that don’t make any sense to Ruby. This is a great feature if you’re learning Ruby at the same time as you’re learning Rails. It has auto completion for “”, [], {} and ending function blocks and even picks up things like when you have one too many ends in your file.
Which files should be checked in?
I couldn’t find a list of what files are allowed to be checked in anywhere in Agile Web Development with Rails. The answer seems to be anything but:
db/schema.rb # easier to let your db:migrate control it config/database.yml # because it contains database passwords coverage/* # generated by rcov logs/* # generated by server tmp/* # temporary sessions files
Don’t overwrite the flash
Bad, no validation errors will be shown:
@model.save flash.now[:notice] = "I saved it"
Better:
if (@model.save) then flash.now[:notice] = "I saved it" end
Will trap and display ruby errors as well as validation errors:
begin if (@model.save) then flash.now[:notice] = "I saved it" else raise "Error saving" end # Do stuff rescue Exception => e flash[:notice] = e.message end
Keep controllers streamlined
I found myself creating one controller that had add/show/delete/list actions for multiple models. It’s much cleaner to have multiple controllers for the individual models.
Conditional Linking
link_to_if will put an unlinked version of the text if the conditional is false. This is much more useful than removing the link text completely for a lot of situations, because you don’t have to worry that the rest of the text around it will look weird. Don’t try to use html_options as a hash! I lost quite a bit of time to this because it won’t use the method parameter, but it doesn’t give you an error.
link_to_if (check_if_user_can_delete),
"Delete Image",
{ :action => "delete", :id => @image.id },
:confirm => "Are you sure?",
:class => "dangerous",
:method => :delete
Generate validates_* off of database
I would have liked it if the generate script automatically generated validates_* helpers off of the database table. validates_length_of could be generated for :limit and validates_numericality_of could be generated for :integer.
Using the same partial to display create/edit/show
This is a neat little trick I found. You can use the same partial for your create/edit/show actions by using html_options and setting
{ :disabled => (controller.action_name == "show" ? true : false) }
for all the fields. It might not be useful for many public applications, but for an internal app it’s a great way to use the same ajaxy displays that you use for create/edit in show.
Polymorphic Associations
Are weird if you want to validate uniqueness. They might work better with has_many relationships than with has_one relationships. Or, I made it more complicated that it had to be.
Deploying sucks
It’s true. Played around a bit with capitrano and vlad the deployer but the both seem to assume you’re using subversion.
Free Tidbit: How crypt works in passwd files
I don’t know why this was so hard to find in Google: passwd files that use the crappy crypt mechanism use the first two characters of the expected password as the salt!
given_password = "hello_world" encrypted_password = "ahga3sgj" return encrypted_password == given_password.crypt(encrypted_password.slice(0,2))
and don’t worry, I’ll talk about something other than Rails later this week :)
Book Review: Ruby on Rails for Dummies
I don’t have anything against the for Dummies series (one of my friends is an author), but they’re only good when you want a very general understanding of a concept. I wouldn’t recommend the series for technical books. But my local library happened to have a copy of Ruby on Rails for Dummies, so I gave it a try.Here’s the good news: if you’ve ever used a programming language or used any HTML then you can skip the first 150 pages.
The 26 pages of how to install the software can be skipped by using InstantRails and then downloading RadRails. You’ll want to pay attention to pages 104 to 112 where the author delves into some of the ways Ruby is different than other programming languages (blocks, yielding, symbols, 0 is true).
The book uses RadRails for all of its examples; which is fine except that it takes so much longer to explain how to do something with a GUI than it does to type rails myproject or script/generate controllers ShoppingCart show. I really hate that they don’t show the one line console command as well as the four pages of GUI operations and screenshots. They don’t specifically mention which version of Rails they’re using, but the installation screenshot shows rails-1.1.2, which is a little on the old side (although the only errata I’ve seen is that require_gem doesn’t work anymore).
Thankfully once you’ve skipped ahead to chapter 8 and they start dealing with Rails in all its glory the book gets a lot better.
What The Book Covers
- Stuff to skip
- Chapter 8: view, controller, partials, helpers
- Chapter 9: model, migration
- Chapter 10: linking with image_tag, link_to, h, how ERb rolls out to HTML
- Chapter 11: uploading a file, storing binary data in database
- Chapter 12: validating input, belongs_to/has_many/many-to-many
- Chapter 13: AJAX, sending email, XML, SOAP web service
- Chapter 14: web sites (most are still alive)
- Chapter 15: lots of ruby-specific tricks with no details
- Chapter 16: Rails concepts aka “I have a job interview in 10 minutes!”
- Chapter 17: using Rails on legacy databases
What could be discussed more
- debug helper
- CSS
- RJS
- Layouts
- Testing
- Fixtures
- REST
- Rdoc
- routing
One thing that’s pretty dang neat is that the author provides his email address and his phone number. That’s an impressive level of service. He tries a little too hard to be funny in the book, but there were some parts that made me chuckle (like when he talks about sending email reminders to his wife, but using instant messaging when he needs her urgent attention).
Unfortunately I’d recommend picking up a copy of Agile Web Development with Rails (AWDWR) instead of Ruby on Rails for Dummy (RORFD). RORFD is split into many small unrelated examples while AWDWR has more extensive example code that you could use as a skeleton for a professional site. AWDWR is much clearer to read than RORFD, which always interrupts the flow with a new figure and screenshot. One page of text may cross-reference up to ten other figures/screenshots/chapters. It feels like RORFD has ADD and it doesn’t make for an easily digestible read.
You can find a more favorable review here.
Getting Started With Ruby on Rails – Week 1

I’ve fallen for the hype and started using Ruby on Rails for building a database driven web application. If you’ve never heard of Rails it is a web framework using the Ruby programming language. Ruby is an object-oriented interpreted language, that’s often compared favourably with Smalltalk. [1] What’s a framework? A framework provides a structure and a set of tools usually for solving a particular type of problem. A programming language solves general problems while a framework extends a programming language to better solve a specific problem.
Rails is a framework for building web applications: stuff like blog software, instant messaging, to-do lists, web magazines, and your favorite web comic. Word on the street is that ROR is a resource hog but the resource consumption is balanced out by how much more productive it is to develop with. It’s easier to buy more computers to host a web application than it is to hire more developers. Computers get more powerful over time; developers not so much.
I’ve been developing websites as a hobby off and on since 1994, but I only learned CSS in the past six months. I’ve done some minor hacking of other people’s web apps that were written in ASP or Perl and they were always horrible messes of spaghetti code. I’m really looking forward to trying out a web app from scratch.
Choose Your Path
I run a Windows machine with a VMWare Linux box inside of it, so I can choose to do my Rails development under Windows or under Linux. If I use Windows then I can use InstantRails, which is a one-click installer that gives you everything to need to start coding ASAP. But I much prefer developing under Linux because you can’t beat the power of having a strong command line. The Windows command line console is a joke, and requires a ton of 3rd party utilities for stuff that’s already there under Linux. [2]
The downside is that there is no one-click install for Linux. Well, except for this one, which I didn’t notice until now :)
Installing ruby, gem and rails is simple and I was able to do it under my user account using the standard –prefix=/home/engtech install options.
Gotcha #1 – MySQL
I already had MySQL installed on my Linux box but it was an extremely old version that blew up the second I tried to use Rails to talk to the database. You need at least MySQL 4 to use Rails because it uses ENGINE=InnoDB for its calls. Older versions of MySQL don’t have InnoDB turned on by default, and once you do turn it on they only understand TYPE=InnoDB.
Mysql::Error: You have an error in your SQL syntax near 'ENGINE=InnoDB'
Tip: Get the latest and greatest version of MySQL instead of whatever came with your Linux install. I needed the Server, Client, and Developer RPMs. MySQL was the part of the install process that required root access.
Tip: If you use a password for your MySQL root account, make sure you change config/database.yml to use it.
Gotcha #2 – Integrated Development Environment (IDE)
Rails doesn’t come with a standard IDE, but instead gives you a wide option of choices. Aptana RadRails, based on Eclipse is a good choice. But I’ve already sold my soul to one editor for all my coding needs: emacs. Emacs is the “kitchen sink” IDE because it supports everything: you can find extensions for any programming language or task. The downside is that it has a learning curve like you wouldn’t believe.
There’s a tutorial on how to add rails support to emacs. It’s long and complicated. Using rails mode in emacs requires upgrading to emacs version 22 that broke a lot of my existing DotEmacs hacks. I eventually got it working, but in retrospect I might have been better off going with RadRails because I lost hours to this. I’m still finding emacs keystrokes that don’t do what I expected them to.
I’m unimpressed that there isn’t a quick reference print sheet for rails-mode, this is the best that I could find. So far I’ve only been using the syntax highlighting and C-c C-c g K and C-c Up / C-c Down to navigate between files.
Gotcha #3 – Development Server vs Production
When I was running into MySQL installation problems, I toyed with using SQLite3 instead for a while. Needless to say, make sure your development database is using the same versions of everything as your development and test servers. It’ll save you lots of headaches.
Initial Opinion
People weren’t lying about how productive programming with Ruby on Rails is. In the same amount of time it took me to write this blog post I was able to get a simple web application with user authentication up and running with a web interface that is probably “good enough” for final release. Which is ridiculous, compared to my previous experience hacking apps together using ASP or Perl.
- Directory structure – Clean, clear, and everything has it’s place.
- Naming conventions – One of the best things a framework can give is enforcing a standard way of naming things. It takes a while to learn it, but it becomes second nature that if a class is called X, the database table is called Y and the tests are called Z. If you leave it to themselves most developers create small inconsistencies in naming conventions that waste time — especially if more than one person is working on the code.
- Don’t Repeat Yourself – I really like the way Model/View/Controller separates the code and keeps it becoming a mess. Inheritance and helpers/partials are great for keeping you from duplicating code.
- Succinct – Wow, you really do get a lot done with very little code writing. They weren’t kidding when they said you could write blogging software in under 15 minutes.
- HTML / CSS / XML – I really love that it doesn’t try to hide the HTML, CSS and XML under a lot of programming calls. There are helpers for doing common things, but you’re free to write your own web code.
- Development / Test / Production – In my limited experience with web apps, I’ve never worked on anything that had more than 20 users. Testing was all done manually, and the production server was the development server. It was a mess. Clean separation makes it much easier to work on code independently and only push it out to users once it has been rigorously tested.
- Migrations – We use to build our database tables using a PHPMyAdmin web interfaces. Needless to say, doing it through scripting where you can tear down, reassemble, and rebuild the database tables is much cleaner because everything is reproducible from scratch.
- Rake, rdoc, and test – One of the things I like most about Ruby is that it has all the fixings I expect from modern languages: the ability to automatically generate documentation off of the code and a built-in unit testing and build framework. I’m always amazed when I see a language that doesn’t natively support these facilities.
- Religion – The big downside to Ruby on Rails is that it feels a little bit like a religion sometimes.
Conclusion
I should have tried Ruby on Rails a long time ago. I spent entirely too much time setting up my development environment compared to when I could have been developing a web application. I could have been up and running in less than an hour if I had:
- Used InstantRails
- Used Aptana RadRails
Footnotes
1 – Did you know that Smalltalk inspired the Macintosh GUI? Smallpark was yet another example of the magic that was going on at XEROX PARC in the 70s. These are the guys who invented the mouse, colour graphic, windows/icons for a GUI, WYSIWYG text editors, Ethernet (how you talk to other computers on a network), and laser printers. Programmers at Work featured interviews with some of the people from PARC.
2 – I’m always amazed that people can program without easy access to diff, find, grep, perl, etc. All of these things are available for Windows for free, but they never work quite the way I expect them to.
Best of Feeds – 34 links – programming, google, lifehacks, ruby, funny
RSS feeds are like cookies (that are good enough for me). Best of Feeds is a weekly collection of the best stuff I saw on the Internet this week. They’re saved on delicious and stumbleupon and cross-posted to Twitter and Tumblr as they happen and then collected together on Saturdays. I don’t blog on the weekend so read these links instead.Subscribe to Internet Duct Tape to see this every week (or get it by email).
- [LIFEHACKS] The Printable CEO
- Collection of PDFs for task/hour tracking.
- (davidseah.com 949 100 7)
- [BOOKMARKING] toread – an email-based bookmark service
- Simple service to use to track stuff ‘to read later’. They store the top 10 for each day. It’s like having an archive of the delicious popular list.
- (toread.cc 938 100 440)
- [RUBY] The Little Book Of Ruby
- 85 page guide to the ruby language syntax, free ebook
- (sapphiresteel.com 492 38 28)
- [CODE] Software Is Hard
- *Excellent* article about software estimation and Rosenberg’s Dreaming in Code
- (gamearchitect.net 449 68 15)
- [STARTUPS] The Future of Web Startups
- Paul Graham on how web startups will start to be standardized and easy to do… which will change everything.
- (paulgraham.com 443 100 671)
- [LIFEHACKS] Top 100 Productivity Blogs
- I’m not on the list, but many there’s a lot of great finds on here.
- (whitepapers.org 440 44 53)
- [RUBY] Ferret – full text search engine
- I’m wondering if this could be a replacement for intranet text search?
- (ferret.davebalmain.com 429)
- [JAVASCRIPT] The Elements of JavaScript Style
- Everything you need to know about writing good javacsript.
- (javascript.crockford.com 336 30)
- [ESTIMATION] Web Worker 101: Estimating Basics
- Nothing new, but good round-up for people who have trouble estimating.
- (webworkerdaily.com 296 36 6)
- [JAVASCRIPT] Learning JavaScript resources
- Good collection of tutorials and links about Javascript
- (juixe.com 289 4 6)
- [CODE] Software Branching and Parallel Universes
- One of the best explanations of software branching in revision control that I’ve ever read.
- (codinghorror.com 274 34 3)
- [GEEK] Flo Control Cat Door
- Image recognition to prevent cat from coming inside with a mouse. Why do I enjoy every link Coding Horror sends me so much?
- (quantumpicture.com 228 80 )
- [RAILS] Rails Rumble: 92 Web Apps Created in 48 Hours
- Winners from the 48 hours Rails Rumble
- (readwriteweb.com 169 28 681)
- [FIREFOX] A Visual Guide to the Firefox Web Browser – Learn Firefox
- via: rooster
- (learnfirefox.cybernetnews.com 167 100 17)
- [RAILS] Build Your Own Ruby on Rails Web Applications
- Free e-book for next 60 days. Probably not as good as Agile Web Development.
- (sitepoint.com 151 100 6)
- [VIRUS] Gathering ‘Storm’ Superworm Poses Grave Threat to PC Nets
- Your antivirus software is completely useless. This is scary.
- (schneier.com 104 62 14)
- [CODE] Inheritance is evil, and must be destroyed: part 1
- Using the strategy pattern vs inheritance with dark jedi examples.
- (berniecode.com 76 9)
- [IPHONE] If wishes were iPhones, then beggars would call
- If you want to hack your phone (dvd player, etc) then buy a phone that lets you hack. Don’t complain about Apple’s lockin when everything they do revolves around lockin.
- (diveintomark.org 60 61 9)
- [LIFEHACKS] 6 Rules for Dealing With Habits vs. Tasks
- Good ideas about how to build habits
- (zenhabits.net 54 8 58)
- [BLOGGING] Blogging is Dumb, Stupid and Successful
- Rant against blogging about blogging and ‘quick tip’ type posts.
- (cornwallseo.com 38 25 716)
- [CODE] What I Learned From X That Made Me A Better Programmer In Y
- From the article: ” We go with Bob’s plan because Bob successfully asserted his dominance over Fred. If we’re lucky, Bob is good at making plans as well as asserting dominance, but if he’s bad at making plans but good at asserting dominance, his plan is still the plan”
- (gilesbowkett.blogspot.com 37 3 2)
- [HUMOR] Microsoft Search
- Microsoft Press releases shows that Microsoft Live Search will finally read the state Yahoo/Google was in 7 years ago.
- (wdr1.com 25 11)
- [LIFEHACKS] shoutingmat.ch (lifehack)
- Interesting agreggator for posts about lifehacks.
- (lifehack.shoutingmat.ch 22 10)
- [SEO] SEOS : The Card Counters of the Internet
- From the article: ” “Google is a casino, and you are a visitor.””
- (johnon.com 19 24 19)
- [HUMOR] Crackbook
- Facebook parody site.
- (theinternetnowinhandybookform.com 16 17)
- [BLOGGING] The 7 Habits of Highly Defective Bloggers
- 7 habits inverted with a view on blogging — what not to do
- (lifetrainingonline.com 12 6 13)
- [PRESENTATIONS] Keynote (The Software) Considered Harmful
- Do presentations and demos with nothing but a whiteboard. Much more interactive.
- (gilesbowkett.blogspot.com 9)
- [SEO] How I reversed my Google ranking penalty
- More on how asking for links with specific anchor text can get your blog blacklisted by google. Contest bloggers be aware.
- (davidairey.com 6 15 14)
- [HUMOR] 300: The Board Game
- I still enjoy the meme :)
- (defectiveyeti.com 5 4)
- [GUESTBLOGGING] Get Your Guest-Posts Here
- Guestblogger for hire, Chris G.
- (chrisg.com 3 18)
- [COPYRIGHT] Has And Belongs To Many: The Problem With Trademarking Rails
- From the article: ” Trademark rights are destructive to the cooperation and trust necessary for successful open source projects.”
- (gilesbowkett.blogspot.com 2)
- [RUBY] When does ( ?? == 63 ) ?
- True dat. Successfully scared me away from Ruby :)
- (sob.apotheon.org)
- [SEO] A Google Allegory at Hamlet Batista dot Com
- Asking for links with specific anchor text can get your blog blacklisted by google. Contest bloggers be aware.
- (hamletbatista.com 8)
- [COMMUNITY] Poisonous People
- OSCON PDF slides from the SubVersion guys. Read the poisonous people one!
- (red-bean.com 5)
Legend
- saves – number of people who bookmarked on http://del.icio.us
- inbound links – number of blogs who linked to it (max 100)
- diggs – number of people who dugg on http://digg.com
This Week at Internet Duct Tape
- Distraction Free GTD: 32 Todo List Web Applications
- Web Runner is a tiny site-specific web application that runs using less resources than Firefox or Internet Explorer. The whole idea behind a site specific web browser is that you want to access a web application without being tempted to access other sites. You want to access a site without being…
- Magazine Review: October 2007 Issue of Inc. Magazine
- I came to a rather startling discovery in the past month: magazines are just blogs with the added luxury of being able to read them while on the toilet or in the bathtub (but hopefully not both). I picked up the October issue of Inc. magazine because Joel Spolsky of Joel On Software has joined the…
- Blog Tip: Create a Link Post in 3 Seconds
- One question I’m frequently asked is “how do you build those Best of Feeds weekly links?” The way I do it is pretty complicated, but I’ve found a much simpler way that I want to share with you all.
- Digest for September 2007
- Every month I publish a digest post collecting the best of Internet Duct Tape.
- Best of Feeds – 30 links – programming, productivity, code, socialsoftware, socialnetworking
- Tags: adsense, advice, blogging, career, code, design, development, firefox, gtd, lifehacks, productivity, programming, ruby, rubyonrails, socialnetworking, socialsoftware, tips, web2.0, webdesign
This Week at IDT Labs
- [AKISMET] Akismet Auntie Spam v2.04
- Our favorite Auntie has a new version. 2007/10/04 version 2.04 – Fixed (some) memory problems with v2.03 – Still slow, I need to get it working with a profiler, none of the hacks for Greasemonkey + Firebug seem to work.
- [DELICIOUS] Delicious Link Builder
- Build a list of links using your delicious account to bookmark them. Works great with my Yahoo Pipe Cleaner script . Example : [BOOKMARKING] toread – an email-based bookmark service Simple service to use to track stuff ‘to read later’. They store the top 10 for each day. It’s like…
- [RSS PIPE] Stupid Credit Builder
- This is a clone of Stupid Feed Rewriter that backdates the entry to January 1st, 1970. Useful for adding a credit link at the end of a list.
Tags: blogging, estimation, free, funny, google, gtd, javascript, lifehacks, productivity, programming, rails, ruby, rubyonrails, search, seo, tips


Comments Off on Delicious Links – 20 links – blogging, windows, codinghorror, amazon, shopping