keynote bingo at our portland office

Courtenay : January 14th, 2008

Like good little fanboys, we’re all going to be sitting around watching the liveblogging of the Steve Jobs keynote tomorrow and playing Keynote Bingo.

Our offices are at 618 NW Glisan, Portland.

Leave a message in the comments if you’re going to be here so we can plan to bring enough coffee. It all starts at 9:00am.

activerecord benchmarks: how fast is your system?

Courtenay : November 8th, 2007

Over a year ago we published some benchmarks on how fast your computers were running the complete ActiveRecord test suite. I consider this to be a great test for the fastest platform for developing Rails. (Let’s ignore the speed of your IDE or pseudo-IDE—this one’s all about waiting for your autotest. This probably isn’t a good indicator of server status)

It’s time to run this test again. Why? Because I’m buying a new computer, and I want to be the most efficient with my money as possible. That means a macbook, rather than macbook-pro.

Check out Rails revision 8117 (trunk at this time), install sqlite if you haven’t already (macports: rb-sqlite), and run rake test_sqlite

Comment here with your platform, and the time reported. If you want to be more accurate, run it a few times. I’m not a professional statistician; don’t tell Zed Shaw about my shoddy procedure.

Factors that may influence your times: disk speed, processor speed, your ruby version, luck …?

Who Hardware Rake time (sec) OS
-- ---- —- -
chrissturm imac core2 18.88 leopard
octopod mbp-sr 23.45 tiger
technomancy mbp-sr 25.74 ubuntu gutsy
defiler mb1 25.772 leopard
form mb2 2.0 26.59 leopard
courtenay macpro 2×2.6 28.49 tiger
mike Athlon64/3000 34.63 xp
courtenay Sempron64/2600 57.49 fc6
courtenay powerbook 1.5 92.92 tiger
  • Summary

From the looks of it, most current-level professional macs whether laptop or desktop run the benchmarks at within 15% of the same time. This probably isn’t too much of a surprise, since ActiveRecord won’t run on multiple processors; but it’s nice to know that if you’re only really doing rails on your laptop, a macbook is as good as anything out there.

The move to Intel has really helped Apple get a nice standard baseline for performance, that clearly smokes the ‘old’ PPCs.

In fact, ‘ol faithful, my previous fast-rails-box running linux on an amd-64, has dropped to very lowly status of 57 seconds. It’s time to retire my trusty powerbook. I spend more time waiting than coding.

Notes:

  • mb1 : MacBook 1 (Core Duo)
  • mb2 : MacBook 2 (Core 2 Duo)
  • mb3 : MacBook 3 (Santa Rosa)
  • mbp-sr : MacBookPro (Santa Rosa)

compiling ruby for the iphone

Courtenay : August 24th, 2007

Here’s how far we’ve come.

You can install the binary ruby from Installer.app, however, it doesn’t run anything useful, and segfaults, errors out, or otherwise refuses to operate.

# ruby setup.rb
setup.rb:1585: [BUG] terminated node (0x15c444)

So, the process is, install the ARM binutils (gcc and friends) with macports. This GCC is ghetto, and doesn’t support everything that regular Darwin GCC does.

sudo port install arm-apple-darwin-binutils

Download ruby, untar it, and apply this patch:

— configure.in.old    2007-08-23 23:22:08.000000000 -0700
+++ configure.in        2007-08-23 23:40:18.000000000 -0700
@@ -530,7 +530,7 @@
              truncate chsize times utimes fcntl lockf lstat symlink link\
              readlink setitimer setruid seteuid setreuid setresuid\
              setproctitle setrgid setegid setregid setresgid issetugid pause\
-             lchown lchmod getpgrp setpgrp getpgid setpgid initgroups\
+             lchown lchmod getpgrp getpgid setpgid initgroups\
              getgroups setgroups getpriority getrlimit setrlimit sysconf\
               dlopen sigprocmask\
              sigaction _setjmp setsid telldir seekdir fchmod mktime timegm\
@@ -630,7 +630,7 @@
 fi

 AC_FUNC_GETPGRP
-AC_FUNC_SETPGRP  
+# AC_FUNC_SETPGRP  

 AC_C_BIGENDIAN
 AC_C_CONST
@@ -1047,7 +1047,7 @@
        rhapsody*)      : ${LDSHARED=’cc -dynamic -bundle -undefined suppress’}
                        : ${LDFLAGS=”“}
                        rb_cv_dlopen=yes ;;
-       darwin*)        : ${LDSHARED=’cc -dynamic -bundle -undefined suppress -flat_namespace’}
+       darwin*)        : ${LDSHARED=’$(CC) -dynamic -bundle -flat_namespace’}
                        : ${LDFLAGS=”“}
                        : ${LIBPATHENV=DYLD_LIBRARY_PATH}
                        rb_cv_dlopen=yes ;;
@@ -1379,7 +1379,7 @@
        ;;
     darwin*)
        LIBRUBY_SO=’lib$(RUBY_SO_NAME).$(MAJOR).$(MINOR).$(TEENY).dylib’
-       LIBRUBY_LDSHARED=’cc -dynamiclib -undefined suppress -flat_namespace’
+       LIBRUBY_LDSHARED=’$(CC) -dynamiclib -undefined suppress -flat_namespace’
        LIBRUBY_DLDFLAGS=’-install_name $(libdir)/lib$(RUBY_SO_NAME).dylib -current_version $(MAJOR).$(MINOR).$(TEENY) -compatibility_version $(MAJOR).$(MINOR)’
        LIBRUBY_ALIASES=’lib$(RUBY_SO_NAME).$(MAJOR).$(MINOR).dylib lib$(RUBY_SO_NAME).dylib’
        ;;
@@ -1430,7 +1430,7 @@
        CFLAGS=”$CFLAGS -pipe -no-precomp -fno-common”
        ;;
     darwin*)
-       CFLAGS=”$CFLAGS -pipe -fno-common”
+       CFLAGS=”$CFLAGS -fno-common”
        ;;
     os2-emx)
        CFLAGS=”$CFLAGS -DOS2 -Zmts”

Edit mkconfig.rb and comment-out the line near the end that begins, Fileutils.touch

Edit ext/Setup and uncomment the first line. Also uncomment socket, digest, digest/md5, etc, fcntl, stringio, syck and zlib.

$ autoconf
$ CC=arm-apple-darwin-cc CPP=llvm-cpp ./configure –host=arm-apple-darwin  –disable-ipv6 –prefix=/tmp

Edit ext/getaddrinfo.c and comment out “gai_strerror” from about line 207. Edit ext/socket/addrinfo.h and comment out the code related to “extern char *gair_strerror”

$ make
$ make install

Hopefully it all compiles for you and you can scp ruby from /tmp/lib and /tmp/bin into your iphone. I just can’t get it to work. Basically, the symbols from those ext/ libraries aren’t available during the final part of “make”.

This article was provided by Mike Pence

The rich web user interfaces of tomorrow will look, and act, like the desktop applications of yesterday, but the web programming tools that are currently in vogue, including Ruby on Rails, are ill-equipped to provide such rich modes of interaction. "A lot of web development, right now, gets done with practices that were good trade-offs 10 years ago," said Avi Bryant, creator of the Smalltalk-based Seaside web framework. "It is really important that we take a very critical look at those practices, and decide whether there might be better ways of doing things."

Talk of better ways of programming is abundant on the web, and often gets cast in the light of religious debate. But unlike religion, there is proof to be had in the realm of developer tools – proof in the form of the products they produce. Avi Bryant's Dabble DB, written in Seaside, stands as a shining example of a how a browser-based app can look and feel every bit as rich as a desktop program.

Read the rest of this entry

Running pyro under webkit nightlies

Courtenay : April 4th, 2007

Pyro is great for keeping your campfire rooms separate, but it leaks memeory almost as much as Safari. Of course it does. I decided to download the latest Webkit and run Pyro under it to see if they’d fixed any memory issues. The jury is still out, but here’s how I did it (after consultation with the Pyro developers)

  1. download the nightly wekit .dmg
  2. Open up the .dmg
  3. Open up a terminal, go to /Applications or wherever Pyro lives
  4. Set some environment variables and open pyro like this:

WEBKIT_UNSET_DYLD_FRAMEWORK_PATH="yes" DYLD_FRAMEWORK_PATH=/Volumes/WebKit/WebKit.app/Contents/Resources/ open ./Pyro.app/

subversion tip

Courtenay : March 6th, 2007

If your project contains svn:ignores for files like *.tmproj or other junk files created by your IDE or editor, then you need to move those ignores to your global subversion configuration (non-windows only). This is because, on a project, you may have four different developers littering the project with their own project-file ignores, and the app’s repository really isn’t the place.

Since a bunch of people in #caboose hadn’t seen this file, I thought it prudent to mention here.

Open up ~/.subversion/config and marvel at the options, then scroll down to about line 54 where it starts, “global-ignores”. Mine looks like this. It includes some logs, the database.yml file, and some AFP junk files.

global-ignores = ._* *.log *.html-gzip-* mongrel_log database.yml *.rej .AppleDouble .DS_Store

Once a file is in here, svn st will never see it again.

svn keychain support

Courtenay : October 13th, 2006

Don't know if any of you saw this.. "http://www.friday.com/bbum/2006/09/12/subversion-14-adds-keychain-support/":http://www.friday.com/bbum/2006/09/12/subversion-14-adds-keychain-support/ from the page: "Quite easy, but not automatic. If you remember all of your repository passwords, simply delete the ~/.subversion/auth/svn.simple directory." woot. combined with ssh keychain, there's almost nowhere to type passwords any more. Now, if only I could get cap deploys working properly.. update: download the binary package from "http://www.codingmonkeys.de/mbo/articles/2006/09/13/subversion-1-4-0":http://www.codingmonkeys.de/mbo/articles/2006/09/13/subversion-1-4-0

Apple File Sharing (AFP) via FreeBSD

Liquid error: undefined method `login' for nil:NilClass : January 18th, 2006

So, I got a shiney new Mac Mini before Thanksgiving. Well, actually it was for my mom, but I ended up keeping it and buying her another. Longer story... In any case I love it, but it's a bit underpowered for heavy unit testing and other intense programming tasks. And I switched from a dual-screen Athlon 1800XP FreeBSD box, so I was feeling lagged for a bit. So with the beautiful Mac OS X in front of me there was only one thing left to do with the FreeBSD box... *Apple file sharing*. :-) I wanted to access files on the FreeBSD box from Finder, edit my Rails projects (on the FreeBSD box) using TextMate, and generally enjoy both the beauty of OSX and the horse-power of FreeBSD on faster hardware. h2. Installation I loosely followed the guide from: "http://viebrock.ca/article/22/file-sharing-from-linux-to-os-x-a-quick-guide":http://viebrock.ca/article/22/file-sharing-from-linux-to-os-x-a-quick-guide Of course that guide is for Debian, hence this post for FreeBSD users. Install from ports: * netatalk * howl h2. Enable the necessary services
Add the following to /etc/rc.conf:
netatalk_enable="YES"
afpd_enable="YES"
mdnsresponder_enable="YES"
mdnsresponder_flags="-f /usr/local/etc/mDNSResponder.conf
You may not need the last line. I have NO idea where FreeBSD howl's mDNSResponder looks for it's config file. I *much* prefer Debian here (for how it gives you reasonable default files that get you started). h2. Setup and start afpd # Rename /usr/local/etc/AppleVolumes.default.dist removing the ".dist" # Change the last line to read as follows:
~ options:usedot,noadouble,nohex
# /usr/local/etc/rc.d/netatalk.sh start The above configuration will allow things like subversion to work that use hidden "dot" files. h2. Test your setup You should now be able to do *Finder -> Go -> Connect to Server...* Connect to: afp://server_or_ip_address/ You should get a list of home directories to browse and mount. If not, you've done something wrong above. h2. Setup and start howl Next, we need to setup howl so that we can automagically find our FreeBSD box on the network. # Create /usr/local/etc/mDNSResponder.conf:
YourServer     _afpovertcp._tcp     local.     548
YourServer     _ssh._tcp     local.     22
# /usr/local/etc/rc.d/mdnsresponder.sh start YourServer is the name that will show up in Finder... you should also be able to use *Terminal -> File -> Connect to Server...* and such for SSH now... Have fun!