Shiny Things
Posts
-
Emacs Book Intro
Here’s something I wrote for the introduction to the Emacs book I started years ago and will never, ever finish writing (“Emacs Mastery: Attaining Coding Supremacy”):
-
Asynchronous Audits are Awesome
Audited is a Ruby gem that adds change logging to Rails models. It’s great for figuring out what happened to a model or a group of related models over time.
-
Phoenix - Seeding Your Tests
If you need to seed your test database when running Phoenix tests, you can require the seed file in
test/test_helper.exs
: -
Emacs and Rails Testing
I’m an inveterate Emacs user. It’s been my Swiss Army chainsaw of choice for over 33 years. Part of the beauty of Emacs is that it’s extensible and configurable. The relatively new1 package manager and ELPA package archive are a great start, but sometimes it’s better — or simply more fun — to roll your own.
-
Of course, with an editor that’s around forty years old almost ↩
-
-
Emptying Full Client-Side Browser Storage
This morning I started seeing the following error on all preview pages generated by an app running on my development machine:
-
Identity Recall
io.com is going away. It’s funny how upsetting this is to me. I’ve been jimm@io.com since 1994 or so—maybe a year or two earlier than that. You know what I’m worried about most? All those open source projects, emails, and other digital resources that point to jimm@io.com are going to be pointing nowhere in a month. It feels like my online identity is being stolen. Except it’s not being stolen, of course—merely recalled.
-
Play Framework Configuration
I’ve been using the Play framework for a big project at work. It’s fantastic. I almost hesitate to say it, but it’s like Ruby on Rails for Java. Watch the video that’s on the home page; it’s a good quick introduction.
-
Up, Up, and Away
Let’s say you are in a subdirectory, and there’s a Makefile in a parent directory. How do you run make? You climb back up to the parent directory and type “make”, or use “make -C parent_dir”. In either case, you have to know what the parent dir is. Here are a pair of scripts that do that for you.
-
ChucK Hack Fork
I’ve created a GitHub fork of ChucK, the “strongly-timed, concurrent, and on-the-fly audio programming language.” In my fork I’ve started to add missing features like string methods, and hope to add many more such as raw file I/O and perhaps some form of MIDI file I/O.
-
A Weak Man Begs Forgiveness
This attempt at humor was written while recovering from the Swine Flu.
-
Using will_paginate in Rails to Submit an AJAX Form
I’m using will_paginate for a Rails project. It works great, but I wanted to use it for a sidebar that performs searches and displays the results. It’s not too hard to write a custom link renderer that will submit the will_paginate link using Ajax, but my situation was a bit different: I wanted will_paginate to inject the page number into the search form and submit the form using Ajax.
-
Time Keeps On Slipping, So Freeze It
A friend of a friend has trouble testing timestamps. I tried replying there, but don’t think my answer got through so here it is.
-
text2midi App Uses midilib
Gabriel G has released text2midi, a Rails app that converts—wait for it—text that you paste into the Web page to MIDI, and plays it for you and lets you download the MIDI.
-
10gen Shifting Emphasis to the Database
10gen has announced that it is Shifting Emphasis to the Database. They decided to focus on the Mongo database after finding that there was much more interest in it than in their Babble cloud computing app server.
-
Doing Homework With a Wii
My younger daughter just said to me, “Dad, I know how to cheat at homework with the Wii.” I asked what whe meant. She said that if you had to alphabetize a list of words (which she sometimes does for homework), you could create a Mii (an in-game avatar on the Wii) for each word, and give it that word as the name. Then use the game’s “sort by name” feature to display all the Miis in alphabetical order. Voila!
-
Rails Without ActiveRecord
When we announced Rails support for the 10gen cloud computing platform, we said that ActiveRecord support was not yet included. This led naturally to the question, “what the heck good is that?”
-
How To Freeze Gems In Rails
Here’s how to freeze any gem into your Rails app. This is a simplified version of the larger discussion Vendor Everything at err.the_blog.
-
10gen Officially Includes Ruby and Rails
For the last four months I’ve been sequestered deep in the heart of the 10gen labs among the test tubes full of bubbling primary-colored liquids, glass jars filled with mysterious biological samples, and mysteriously glowing rectangular pixilated displays. The whole time, I’ve been pressing small plastic keys in arcane sequences and muttering to myself.
-
Clojure Mystery Solved
I figured out what was wrong with the Clojure code in the Mongo Java Driver Clojure sample: we weren’t turning the value returned by the database into a seq. You can see the fixed version here.
-
Ruby Mongo Driver Progress
Over the last few days I’ve added a few features to the Ruby Mongo driver:
-
Ruby Mongo driver
I’ve been working on a pure-Ruby driver for Mongo, 10gen’s document database. If you are of the Java persuasion, then check out Geir Magnusson Jr’s Java driver for Mongo.
-
Ruby in the Clouds Video
The videos of most of the RubyConf 2008 talks are now available online at the Confreaks RubyConf 2008 web site, including my talk Ruby in the Clouds.
-
Clojure
I’ve been playing a bit with Clojure recently. Playing only: I haven’t written anything serious yet. One thing I did write, though, was the Clojure example in Geir Magnusson Jr’s Java Mongo driver.
-
Ruby In the Cloud
I’ll be giving the talk “Ruby In the Cloud” at RubyConf 2008 in November. For a poorly-formatted outline, see http://rubyconf.org/talks/20.
-
Downpour
Here’s a bunch of big news from cloud computing application framework company 10gen: their SDK is now available for download, they are making the entire platform Open Source, and they’ve received Series A financing. Congratulations to 10gen for reaching these big milestones, and for the decision to make their code Open Source.
-
Magpies and Shiny Things
Over at Coding Horror Jeff Atwood just posted The Magpie Developer. As somebody with a blog named “Shiny Things”, I’m well aware of my penchant for new technologies. Recently, it’s been Scala and Erlang.
-
LilyPond
I’ve always wanted to learn to use LilyPond. My first two attempts are Mosquito Byte Rag [link fixed] (PDF, 148K) and a piano version of the Equal Rites Main Theme (PDF, 117K). There are no dynamic or note markings yet.
-
JavaScript Crashing Mac OS X Firefox 2.0.0.9
Recently I upgraded to Firefox 2.0.0.9 on Mac OS X. Ever since then, Firefox has been crashing extremely frequently. Most often, it’s when I’m closing a tab—usually GMail.
-
Gmail Adds "Delete" Keyboard Shortcut
Today my GMail account was upgraded to the new interface. The contacts management interface has been improved, but that’s not what I’m excited about.
-
Halloween Emacs Tips
Here in time for Halloween: a new section on my Emacs tips page about skeletons.
-
Yaws and Mnesia
I’m playing with translating a small Web application from Rails to the Erlang web app framework Yaws. When I tried to access a Mnesia database from a page, it failed because Mnesia wasn’t running. Oops. I tried running it from another erl shell, but that didn’t work.
-
Erlang Notes
Two Erlang-related notes, neither about the language /per se/. First, take a look at “Why do you like Erlang?”. I love the Magic card. The article’s good, too.
-
CSI:Munich - ZFS Saves the World
CSI:Munich - ZFS Saves the World. Warning: for geeks only.
-
Star Ship Dave
Occasionally movies, TV shows, and ads are filmed around where I work in NYC. I’ve never seen a “star”, but I often see the food trailers and office trailers and once or twice I’ve seen locations with cameras and lights—no action yet, though.
-
Firefox - Of Thee I Sing; Thunderbird - Of Thee I Hum
or: Don’t Fence Me In — or: Freedom, by George Michaels
-
Erlang Boids Simulation Design
As one of my Erlang programming exercises, I decided to write the non-graphical part of a Boids simulation. I’ve written the same thing in a few different languages (Java, Ruby, Lisp, C++) before. Using Erlang would be interesting because of its support for message-based parallelism and concurrency.
-
Feeling Left Behind
A few months ago, a study surfaced on Reddit that stated that the ability to digest milk in human adults is a relatively recent adaptation. It further posited that this ability was convincing proof of the theory of evolution: humans have evolved to be able to digest lactose later in life.
-
Speedier Erlang
In the comments to Erlang Fractal Benchmark, Ulf Wiger noted that adding
is_float
guard clauses speeds up the code. -
Erlang Fractal Benchmark
While looking at a simple fractal benchmark that showed up on the programming Reddit, I noticed that there wasn’t an Erlang version. Below is one I wrote last night. Erlang fares rather well. One thing mildly surprised me: it runs slightly faster in an Erlang shell within Emacs than in both Apple’s Terminal and iTerm on Mac OS X. Within Emacs it runs in 1.09000 (runtime) 1.14100 (wall clock) seconds. In both Terminal and iTerm it runs in around 1.11000 (runtime) 1.16600 (wall clock) seconds. Perhaps screen I/O isn’t as fast in the terminal programs.Two caveats: first, these numbers were generated on my 2.33 GHz Intel MacBook Pro; I don’t know what the original benchmarks used. Also, I only ran the code a handful of times and picked a “typical” time to report. A better test would have been to run the code hundreds or thousands of times and average the values.This post also says a bit about intuition vs. measuring. I discuss some code modifications and their expected and actual effects below.Another thing to note: the author of the fractal benchmark page says that he hasn’t bothered to optimize the code for each language he tested. I don’t know if using
lists:map/2
or extractingiter_value/5
and using guard clauses would disqualify this version in his opinion. -
Learning a New Programming Language
I’m a self-professed language maven. I love learning new programming languages. Recently, I’ve been learning Erlang, thanks to Programming Erlang by Joe Armstrong, the online documentation, and the Erlang mailing list.
-
An Erlang MIDI File Reader/Writer
I’ve been learning Erlang. (See Learning a New Programming Language.) As part of that process, I’ve written three programs so far: a Boids flock simulation, a simple Web application using Erlyweb, and a MIDI file reader/writer.
-
Scala Baby-Steps
I’m starting to learn Scala. It’s a statically- and strongly-typed functional language that compiles to Java byte code and integrates well with Java.
-
Firebug
Firebug is an incredibly useful Firefox extension for developers. You can debug JavaScript, edit HTML and CSS, inspect the DOM, determine the download times of all of the elements on a page, inspect headers, and much more.
-
Just Try It
I love answering programming questions. It lets me feel like a grizzled veteran sharing my arcane knowledge with those eager to learn. (Yes, I’m delusional.) If I don’t know the answer, I enjoy finding out.
-
Java's Enhanced For Loop Mystery
I like Java 5’s new enhanced for loop. It makes the code that iterates over collections and arrays less verbose. Anything that reduces Java’s verbosity is a good thing in my book.
subscribe via RSS