This is one of those errors in Rails that just make you go WTF!? The amount of debug information is minimal, and the row that supposedly is the culprit is syntactically correct. Even Google doesn’t really help. I gather that this error can occur in several different contexts and caused by different things, so I’m not trying to provide an all purpose solution to this. The case I’m going to show you is probably quite rare, but it happened to us at work today. I never figured out exactly why Rails chokes in this situation, but I found a way to reproduce the problem and also a solution. The main characters in this drama are the respond_to and render methods, and the main villain is a mysterious invisible parameter.
Archive for the 'Geek speak' Category
I just wrote my first ever AppleScript to solve a problem I’ve had for some time. As I’ve mentioned several times before, I use the MPD music player on my HTPC to play music through my amplifier while controlling playback using my laptop or mobile phone. This works like a charm and I’ve been really satisfied with this setup — until I fell in love with iTunes’ Genius function.
I use iTunes on my MacBook and mainly at work, either listening through my headphones or streaming music to the office speakers using our AirPort Extreme. As my library is rather diverse, I like to use Genius to get an ad hoc playlist of similar songs to avoid the “shuffle all, press next until a good song comes along” selection method. Needless to say, Genius has worked fabulously. However, when I come home and start playing music through MPD, I’m back to the shuffle all hell since I can’t be bothered creating playlists manually.
So this got me thinking: Is there any way I can use iTunes Genius together with MPD? The answer is yes, and the tool I used is AppleScript.
I’ve already gone on about how fantastic MPD (Music Player Daemon) is. The server-client music player has totally changed the way I listen to music at home. By having the MPD server (that actually does the playing) constantly running on my HTPC connected to my amp and speakers, I can control the music playback from any device that has an MPD client written for it. Since the server doesn’t stop playing if a client quits, I can start playback using one client and stop it using another.
Until today, I had a couple of text-based clients on the HTPC itself (for controlling playback over SSH ;), two-three clients on my laptop, one on my girlfriends laptop and one on her iTouch. Chances are quite high that at least one of these are switched on and within reach at any given time. However, there are times when both laptops are shut down, the iTouch has run out of batteries, I’m late for work and MPD is happily playing since I forgot to stop it before I put my Macbook to sleep. This morning was such a time.
When I was new to MPD and wanted to install clients on everything including the toaster and microwave oven, I tried out a client for S60 mobile phones. As far as I remember, something didn’t work and I probably lost interest and thought that my gazillion clients already installed would suffice. Well, today I started looking into it again, the JavaME client for MPD, Remuco.
Continue reading ‘Control MPD from your mobile phone with Remuco’
Every once in a while I need to set up a temporary SSH tunnel from one computer to another, possibly via a third one, and can’t be bothered with configuring any of my otherwise frequently used GUI tools ‘SSH Tunnel Manager’ for OS X or ‘SSH Tunnel’ on Win XP. Each time, however, I end up reading the man page for the ssh command or googling for ’ssh tunnel linux’ or something similar, since I never seem to remember how to set up a simple SSH tunnel on the command line. The ssh man page is especially unhelpful:
-L [bind_address:]port:host:hostport
What? Which port goes where? And what’s the bind_address and hostport? If you read the explanation of the switch you’ll probably just become even more confused. After a few trials and errors I usually get my SSH tunnel up and running, but most of the time I’m not quite sure what I’ve really done.
So here’s a note to self on how to do this once and for all.
