Tequila Fish Ran-dumb ramblings of me…

4Dec/07Off

jQuery: How to set one <select> element to the value of another (using onchange equivalent)

Say you have an HTML <select> form element and you want to set another <select> element equal to the first one when it changes. Here's an easy way to do so with jQuery:

$('#id_of_select1').change(function() {
    var select1_value = $(this).val();
    $('#id_of_select2').val(select1_value);
});

----------------
Now playing: Drexciya - Astronomical Guidepost
via FoxyTunes

4Dec/07Off

jQuery: How to get the ID of an element.

Say you want to know the ID of an element using jQuery. You can achieve this easily using jQuery's attr() method:

var currentId = $('#element').attr('id');

But this is fairly useless, because it requires you to already know the ID of the element that you want. Usually you'll want to find out the ID if you don't already know it -- given a jQuery 'this' object:

var currentId = $(this).attr('id');

This will only work provided that you have a valid jQuery object $(this) that you are working with, eg:

$(document).ready(function() {
  $('input.text').focus(function() {
    $('input.text').removeClass('onFocus'); /* remove focus state from all input elements */
    $(this).addClass('onFocus'); /* add focus state to currently clicked element */
    var currentId = $(this).attr('id');
  });
};

Using the code above, you will now know the ID of the currently focused input element. This can come in handy later on if you want to perform further actions on the element.

----------------
Now playing: Amon Tobin - Precursor (feat. Quadraceptor)
via FoxyTunes

29Nov/07Off

Thunderbird HowTo: Show email count in folder pane.

If you'd like to see a count of how many emails are contained in each folder in Thunderbird, here's how:

  1. Tools > Options > Advanced > General
  2. Check "Show expanded columns in the folder pane"
  3. Click OK to accept changes.
  4. At the top of the folder pane, click the column selection icon (Thunderbird Folder Icon) and select the columns that you would like to see. You can choose to display Total, Unread, and/or Size.

----------------
Now playing: Physics - First 7" - Side 2
via FoxyTunes

28Nov/07Off

Crusty Old White Dude Ratio: Democrats vs. Republicans

Using the pictures below, I've calculated the crusty-old-white-dude ratio for both the Democrats and Republicans in the 2008 Presidential Campaign debates:

Democratic crusty-old-white-dudes: 5/8 = 62.5%
Republican crusty-old-white-dudes: 10/10 = 100%

Click photos for bigger versions:

Democrats:
Democrats
Republicans:
Republicans
28Nov/07Off

Squarepusher Q&A

Squarepusher Q&A
Came across this pretty fuckin-a-awesome Q&A session with Squarepusher on the BBC site. At some points he comes across as a rambling human thesaurus, at others an enlightened philosophy Ph.D., and still others the manical musical genius we've grown to love. I'd love to sit next to this dude in a pub and chit-chat for hours over some cold ones. Choice quote:

I'm interested to further my knowledge in [the cocktail] department, but as I live in a tiny Essex village with one pub that struggles to serve a decent pint of beer, my day-to-day chances of achieving this seem slim.

30Oct/07Off

iPod stuck with Apple logo on screen

My 3G iPod got stuck with the Apple logo on its screen. The way to fix this is to put the iPod into Disk Mode and restore it from there. Here is how:

  1. Reset the iPod by holding down the Menu and Play buttons simultaneously.
  2. As soon as it reboots, hold down the Fast Forward and Rewind buttons simultaneously.
  3. Your iPod will now be in "Disk Mode" and you should be able to plug it into your computer, open up iTunes, and restore your iPod.
Tagged as: , No Comments
30Oct/07Off

iPod does not appear in iTunes.

I have an old 3G iPod, and all of a sudden it would not show up in iTunes when connected to my computer via Firewire or USB. It did show up in Finder. After some research, the only way I found to fix this is to format it using Apple's Disk Utility. WARNING: Doing this will wipe everything off your iPod. You won't be able to recover the files off your iPod, but at least you'll be able to use it with iTunes again.

  1. Connect your iPod you to your Mac.
  2. Open up Disk Utility (Finder > Applications > Utilities > Disk Utility).
  3. Select your iPod in the left-hand window pane.
  4. Click the "Erase" tab, accept all defaults, then click the "Erase" button.

Your iPod will now be re-formatted, and you should be able to plug it into iTunes and Restore the updated iPod software.

UPDATE: For PCs, you may be able to do something similar with Windows' Disk Manager. I haven't tried though, so I can't verify, but I bet it would work on Windows too.

Tagged as: , , No Comments