As a PC user by day, Mac user by night, I have a few gripes. One of them deals with the Mac's implementation of the Home and End keys. I think Windows has won here by assigning less frequent tasks to modifier key combinations. The Mac, on other hand, takes you to the top or bottom of a page without modifier keys. To make matters worse, the default action does not move your cursor along with the change in view. It's rare that I'd ever want to do this and by not moving the cursor along, it's fairly useless. I'm constantly misusing them to the point of being distracted by it.
I found a utility app called DoubleCommand that goes a long way to solving the problem. The app was made for users to remap keys when using PC keyboards on a Mac. It has an option to make Home/End behave more PC-like. Amen. Press the End key by itself and you'll go the the end of current LINE. Vice versa for the Home key. Holding Shift down while pressing these keys selects the text along the way.
Life Refactored
Same old problems, new ways to screw up.
Sunday, May 27, 2012
Friday, May 25, 2012
Efficiently Rate Your Music Collection Into Submission
The Problem
I want to rate the tracks in my music collection efficiently. The ratings can be used to:
- Generate playlists
- Remove music I don't like
- Share music that I like with friends
- Pick the music to be synced across my devices
The problem is that there are too many steps to rate music as you listen to it. It's a perfect multitasking activity, but most media players don't provide anything out of the box to help you keep on task. The standard workflow is to switch to your media player, rate the currently playing track, select the next track to play, and then switch back to what you were doing. That's four steps!
In reality, you get sucked into spending most of your time in the media player because of tracks that rate poorly. Those sad tracks tend to come in groups, especially on albums with the typical quota of one to three good tracks. So, instead of thrashing back and forth between your media player and your work, you stay in the media player waiting to get to a track you are willing to listen to for a while before rating. Eventually, you start enjoying a track too much and forget to rate it or you simply find the idea of breaking your train of thought yet again too frustrating. So you give up. You're left with a handful of tracks rated and one more promise of technology unfulfilled. Before you know it, you spend all of your time on Pandora, last.fm, or Spotify and you try to forget all of that time you spent ripping your music collection to mp3s. :)
Well, I think there's some hope.
A Solution
How about being able to rate the currently playing track and start playing the next unrated track without ever having to leave your work, and do this in one step!? It's as good as it gets, I think.Here's a guide to setting up global keyboard shortcuts and voice commands on a Mac to rate your music in iTunes. Between hotkeys and voice commands, you should be able to rate music easily in any scenario. I'll try to follow up with a Windows guide later. If you don't like iTunes, you should be able to apply the basic concepts here using just about any media player.
Here's an outline of the steps:
- Configure iTune to show half-star ratings (ex. 3.5 stars).
- Install AppleScripts that automate iTunes. I provide the scripts below.
- We'll place the scripts in a special folder for speech commands and name the scripts properly to turn them into voice commands.
- For global keyboard shortcuts, we'll install a great utility called Spark and then configure Spark to use the scripts.
- Create a smart playlist that only includes unrated tracks.
- We'll set iTunes to shuffle and then play our unrated tracks smart playlist. As we go about our normal routine on the computer, or up and about getting things done around the house, we'll easily rate our music using the global keyboard shortcuts or the voice commands. Headphones with a microphone are recommended for voice commands.
1. Configure iTunes to show half-stars for ratings
First, quit iTunes, then enter this command in Terminal:defaults write com.apple.iTunes allow-half-stars -bool TRUE
Relaunch iTunes, and you'll find you can now click between the stars (in the Ratings column) to get half ratings. You can also drag across the stars and you'll see the half ratings.
2. Install iTunes AppleScripts
Download the scripts I created first. Extract the scripts into the following folder: /Users/{Your Username}/Library/Speech/Speakable Items. One way to access the Library folder is to open the Go menu in Finder and hold down the Options key on your keyboard. Library should now be visible. Choose Library and then navigate to Speech/Speakable Items.The filename of each script will become the voice command. You are free to reword the filenames, but make sure to keep the file extension in tact (.scpt) as it's needed by Spark in a future step. Don't worry, the filename extension will not be part of the voice command so there's no need to figure out how to pronounce scpt.
Speakable Items folder |
3. Install and Configure Spark
Download Spark and install it. It's a really great shortcut key utility for the Mac.Next, you need to assign shortcut keys to the AppleScripts.
Example Spark Setup |
- Click the large button on the toolbar to choose "All Application's Hotkeys" since we want to create global, system-wide shortcuts.
- Click the Gear drop-down button on the toolbar and choose AppleScript. This tells Spark that you're going to create a new keyboard shortcut that can be used from any application and it will launch an AppleScript.
- In the configuration page that appears, choose the hotkey (I used control+option+function keys for each rating level), name the shortcut whatever you want (it's just to help you identify the shortcut within Spark), and click file then choose the corresponding AppleScript file located in the Speakable Items folder.
- Click the "Start Spark Daemon" button.
4. Create Smart Playlist
In iTunes, choose "New Smart Playlist" from the File drop-down menu. Then create a rule where Rating is less than 1 star or equal to no stars. Take your pick. My rule is for less than 1 star which means it will include tracks that were assigned 0.5 stars. If I'm undecided about deleting a track, I give it a 0.5 so that it will appear again in the rotation later for me to consider again.5. Start Rating Your Music!
- Turn on shuffle in iTunes.
- Start playing your Unrated Music Playlist.
- Test your hotkeys: No matter whether you are in iTunes or another application, you should be able to use your hotkeys to assign a star rating to the currently playing track and skip to the next track immediately.
- Enable Speech Recognition in System Preferences. Using a headset with a microphone, try issuing the speech commands to rate tracks. I find that my voice commands are not well understood if my microphone sensitivity is too high. Make sure to use the mic calibration tool and keep the bars in middle greens.
Supplied Scripts
Along with the ratings scripts, I created scripts for:
- Going to the previous and next tracks.
- Going back and forth 30 seconds at a time within the currently playing track.
- A script to delete the currently playing track and skip to the next track.
I see these as the essential scripts for rating tracks. You may want to add your own (like scripts that rate the currently playing track, but don't skip to the next track immediately). To make your own script, just copy and paste one of the existing scripts in Finder, give it a new name, and then double-click it to open it for editing.
Good luck and long live your music collection!
Monday, May 21, 2012
Quick Search
I finally figured out just how short life is and I'm in the process of consolidation. I'm retiring my personal website and moving over to free blogs. I had a page on my site that is still relevant and useful about something called Quick Search. Here's an updated version:
Most web browsers today allow you to perform site-specific searches or "macros" from the address bar. Internet Explorer was the first one implementing such a feature that I was aware of many years ago called IE Quick Search (as a "Web Accessory" for IE4 and standard functionality in IE5). Essentially, you could navigate to and search on a website in one step by typing a command like this into the address bar:
imdb Being There
By typing this into the address bar, you'd be taken to imdb.com to see the search results for the movie, "Being There." Nice time saver. It was a powerful feature in a time before Chrome and unified "Omnibar" address bars.
Omnibars configured to search on Google come close to replacing Quick Search, but there's still the extra step of visiting Google before getting to your destination site. For that reason alone, Quick Search is still valuable.
IE Quick Search was configured via registry entries. At the time, I put together a registry file with a bunch of useful macros. I haven't tested them in a long time. I'm sure half work and half don't. Come to think of it, this little reference sheet is an interesting test of the hows and whys of web UI and API stability, to some degree.
Here's the registry file to import Quick Search commands
Here's a reference sheet for the Quick Search commands
If you look at the registry file, you'll quickly see that %s in a URL is replaced by whatever the user searches for, such as "Being There" in the example above.
In the past, if you told Firefox to import IE settings, you'd get the Quicksearch entries. I suspect this is still true and perhaps Chrome does it too. You'll have to find out for yourself.
If you want to create new entries manually:
Chrome: Go to Tools > Settings > Search Engines. Here, you can add keywords and URLs with %s for the search term placeholder.
In Firefox, you add keywords to bookmarks.
Firefox: Bookmarks > Show All Bookmarks.
To create your own Quick Searches, you'll need to figure out how to compose the URL and where to put the %s token. Usually, you can do a search on a site and then look for the keywords you entered in resulting page's URL. Sometimes though, you'll need to do some extra work if the page is posted or the site redirects or the data is obfuscated, etc.. It's not my intent to teach these things in this post.
Quick Search can also be useful for searching your personal or business web applications. Furthermore, you could create macros that actually do work instead of search for things. Quick Search macros could send text messages, add items to databases, create events, etc..
Oh, there was a site that came along a long time ago that took the idea of Quick Search to a new level. I'll try to find them and update the post.
Most web browsers today allow you to perform site-specific searches or "macros" from the address bar. Internet Explorer was the first one implementing such a feature that I was aware of many years ago called IE Quick Search (as a "Web Accessory" for IE4 and standard functionality in IE5). Essentially, you could navigate to and search on a website in one step by typing a command like this into the address bar:
imdb Being There
By typing this into the address bar, you'd be taken to imdb.com to see the search results for the movie, "Being There." Nice time saver. It was a powerful feature in a time before Chrome and unified "Omnibar" address bars.
Omnibars configured to search on Google come close to replacing Quick Search, but there's still the extra step of visiting Google before getting to your destination site. For that reason alone, Quick Search is still valuable.
IE QuickSearch
IE Quick Search was configured via registry entries. At the time, I put together a registry file with a bunch of useful macros. I haven't tested them in a long time. I'm sure half work and half don't. Come to think of it, this little reference sheet is an interesting test of the hows and whys of web UI and API stability, to some degree.
Here's the registry file to import Quick Search commands
Here's a reference sheet for the Quick Search commands
If you look at the registry file, you'll quickly see that %s in a URL is replaced by whatever the user searches for, such as "Being There" in the example above.
Other Browsers
In the past, if you told Firefox to import IE settings, you'd get the Quicksearch entries. I suspect this is still true and perhaps Chrome does it too. You'll have to find out for yourself.
If you want to create new entries manually:
Chrome: Go to Tools > Settings > Search Engines. Here, you can add keywords and URLs with %s for the search term placeholder.
In Firefox, you add keywords to bookmarks.
Firefox: Bookmarks > Show All Bookmarks.
To create your own Quick Searches, you'll need to figure out how to compose the URL and where to put the %s token. Usually, you can do a search on a site and then look for the keywords you entered in resulting page's URL. Sometimes though, you'll need to do some extra work if the page is posted or the site redirects or the data is obfuscated, etc.. It's not my intent to teach these things in this post.
Quick Search can also be useful for searching your personal or business web applications. Furthermore, you could create macros that actually do work instead of search for things. Quick Search macros could send text messages, add items to databases, create events, etc..
Oh, there was a site that came along a long time ago that took the idea of Quick Search to a new level. I'll try to find them and update the post.
Tuesday, August 16, 2011
Faking Custom CSS Properties
I ran into a situation today where I really needed to create my own, custom CSS property. For example:
.myclass {
my-property: 0;
}
Essentially, I needed a presentation value that was related to other elements on the page, but could not be derived or calculated based on those elements. In an effort to keep presentation separate from code, I wanted custom CSS properties. While I won't go into explaining exactly why I needed the custom property, I will show you how I accomplished the task:
HTML
<div id="foo">hello</div>
CSS
#foo {
background: url('images/spacer.gif?bar=411');
}
.myclass {
my-property: 0;
}
Essentially, I needed a presentation value that was related to other elements on the page, but could not be derived or calculated based on those elements. In an effort to keep presentation separate from code, I wanted custom CSS properties. While I won't go into explaining exactly why I needed the custom property, I will show you how I accomplished the task:
HTML
<div id="foo">hello</div>
CSS
#foo {
background: url('images/spacer.gif?bar=411');
}
JavaScript
getCustomCSSProperty('foo', 'bar');
Supporting JavaScript Functions
function getCustomCSSProperty(elId, propName)
{
var obj = document.getElementById(elId);
var bi = obj.currentStyle ? obj.currentStyle.backgroundImage : document.defaultView.getComputedStyle(obj, null).getPropertyValue('background-image');
var biurl = RegExp('url\\(["\\\']?([^"\\\']+)["\\\']?\\)').exec(bi);
return getParameterByName(propName, biurl[1]);
}
function getParameterByName(name, qs) {
var match = RegExp('[?&]' + name + '=([^&]*)').exec(qs);
return match && decodeURIComponent(match[1].replace(/\+/g, ' '));
}
Demo
How It Works
Basically, I use the query string of a background image URL to store my custom CSS properties. Each key of the query string equals a custom CSS property. I set the background image to a 1x1 transparent pixel so that a valid request is made to my website and a very small transfer needed. By specifying a static resource, I can rest assured that the query string will be ignored by the web server (most web servers are configured to ignore the query string for static content and return the resource). I use a little JavaScript to access the background image property of the element, parse the string to extract my property value and voila!
If the element I'm styling really needs a background image, I'll simply add my query string to the URL of the real image.
Caveats
- A request must be made for each unique string of custom CSS properties since the browser considers each URL to be unique (i.e. "images/spacer.gif?bar=411" vs "images/spacer.gif?bar=911"). Caching will come into play after the first request though.
- You must URL encode the name/value pairs in the query string.
- You could conceivably run into namespace issues with your query string if you really need to use a background image on the element and require a legitimate query string on the URL to retrieve the image.
Alternative Solution
There is a jQuery plugin that lets you craft custom CSS properties. It is a much more extensive, powerful solution allowing you to include script in your CSS: http://bililite.com/blog/2009/01/16/jquery-css-parser/
Advantages of my solution over the jQuery CSS Parser
- No jQuery library necessary. Only a little JavaScript is needed.
- The CSS remains valid (although the jQuery parser does allow its properties to be enclosed in comments).
Saturday, June 21, 2008
WarGames Sounds
Over the last few months, I've been completely hooked on the 1983 cult movie classic, WarGames. I'm ashamed to admit just how many times I've watched it. Let's just say that I have many of the lines memorized by now.
One of the things that I love from the movie are the sound effects. I think they did a great job of bringing computers to life with all of those cleverly engineered beeps. I particularly like the sound they used whenever someone would type on a keyboard. The sound was essentially the same for text that would appear on a screen. Naturally, I wanted these sounds on my computer. I searched Google high and low and couldn't find anyone that had bothered to grab those sounds. All that I could find were classic clips like "would you like to play a game?" So, I've extracted the sound clip myself along with a few others that I thought were interesting and possibly useful.
I created two versions of the keyboard sound (one is louder than the other) to suit personal preference and listening environment. You'll need a program that plays a wav file in response to typing on your keyboard. I've found a few programs that fit the bill. I'm currently playing with a program called Noisy Keyboard.
Below are links to individual wav files as well as a zip archive of all the sounds. There are a handful of sounds that are my favorites that I've grouped at the top. I thought the remaining sounds might be interesting to some people. I hope you enjoy them.
P.S. I did not bother to reproduce the sounds clips from the movie that can be readily found on other sites.
All sound files are standard 16bit, stereo, Windows WAV files sampled at 48kHz.
WarGames-KeyPress.wav
WarGames-KeyPress-MiddleVolume.wav
WarGames-KeyPress-LowerVolume.wav
WarGames-Startup.wav
WarGames-Login-WOPR.wav
WarGames-Shutdown.wav
WarGames-Alarm.wav
WarGames-Alarm-SkyBirdBreakBreak.wav
WarGames-Chimes.wav
WarGames-ConnectHello.wav
WarGames-DiskInsert.wav
WarGames-Login-BunkerDoor.wav
WarGames-Login-ProtovisionIHaveYouNow.wav
WarGames-Login-WOPR-FullWithFootsteps.wav
WarGames-Modem.wav
WarGames-ScreenRender.wav
WarGames-ScreenRender-Longer.wav
WarGames-ScreenRenderWithPrinter.wav
WarGames-Shutdown-BeginCountdown.wav
WarGames-Shutdown-WithJennifer.wav
WarGames-Shutdown-WithJenniferAndDavid.wav
WarGames-Startup-BunkerDoor.wav
All WAV files: WarGamesSoundPack.zip
Sunday, April 06, 2008
Moov: LEGO For Kids' Vehicles
I think this design-your-own trike/bike/whatever toy called Moov is really cool. What young boy wouldn't love to tinker with this kit to design their own little vehicle? What a great way for kids to spend time with their dads. How about Moov competitions where kids get together to race their creations. Yet another reason to stay young. from gizmodo.com
Interactive Textiles Used To Improve Human Performance
CSIRO of Australia are embedding technology into wearable textiles in an effort to help people improve their performance. You train the apparatus to recognize the ideal movement for an activity so that it can detect variations in movement that are not ideal. The device plays a set of audible beats to help you improve your performance. Shooting hoops was the first activity discussed, but it could be used for any activity. I'm sure athletes will be the first segment interested in the technology, but I could see it helping just about everyone. Imagine your intelligent workout clothes guiding you into proper form for any exercise. Love it. from gizmodo.com
Navigate A Maze To Unlock Your Door
This one makes me laugh for some reason. When I saw this I immediately thought of pranking someone by installing it in the middle of the night so that I can have my first laugh of the day watching them stare at this thing on their way out to work in the morning. Thanks go to Art Lebedev Studios for creating the Defendius door chain. :) from gizmodo.com
Glow In The Dark Graffiti: Great. (sarcasm)
A company called Suck UK from our friendly global partner across the pond has created a spray paint that glows in the dark. I'll admit that I'm curious to see the resulting graffiti art, but it won't be long before we're all disturbed by this new menace. Yes, menace. The product is due to be available soon. from gizmodo.com
Wednesday, March 26, 2008
Technosexuality: Robot Love
I watched a movie a few months ago about a guy who ordered a robot and dated it after failing at relationships with his human counterparts. It turns out that there is person doing this in real life. I can only guess that the movie was based on this guy. It's a very interesting concept and a bit disturbing. I recommend reading an intriguing interview between gizmodo.com and Zoltan, the technosexual.
Subscribe to:
Posts (Atom)