Great percussionist video: Evelyn Glennie
Posted by Simon on December 24, 2008 at 01:42 AM
Categories: music
Evelyn Glennie is a deaf percussionist. I guess that this is possible because percussion creates vibrations that you can feel with your feet, your hands, your fingertips, maybe even your whole body. She is now one of the few or only professional solo percussionists in the world. Anyway, the TED conference gave her a 30 minute session which is reproduced here in high definition (definitely consider plugging into decent speakers or headphones). Evelyn Glennie on "How to Listen". Click on the High Definition link under the video to get the real video.
My home theatre: Audioengine 5, Airport Express, Sharp Aquos 32D64U, and a Mac Mini
Posted by Simon on December 23, 2008 at 01:17 AM
Categories: music, mac, bittorrent, film
Someone asked me recently to describe my home theatre. I've put quite a lot of thought & work into it. But not a lot of money. My goal from the start was to achieve the maximum return with the minimum of complexity.
So, right from the start I knew that it was going to be as much digital as possible. I don't care about live TV and I'm a bittorrent expert so I knew I couldn't have to mess around with cable connections. But more to the point, being digital means you don't have to worry about analog components or duplication. For example, you can concentrate on having just a single Digital/Analog Converter (DAC)... a key component in your audio set-up.
The first thing I bought was the DAC & speakers. I had a new apartment and I wanted to be able to listen to music there. In particular, I wanted to be able to do two things: listen to music coming off my Nokia N95, which functions like an iPod, and listen to music coming off my laptop, a MacBook Pro. I did a lot of research online to figure out how I could get the best sound with a budget of $400. And I wound up finding a REALLY nice pair of speakers.
I actually restricted my search strictly to powered speakers, or, as they are commonly called, "ipod speakers"... and most of them are fairly crap. Even the ones from Apple didn't really score that well when I listened to them. I'm a musician on the side and I know what good sounds like. None of the ones I could find in stores reproduced sound the way I wanted—clean, like the original, faithful. They were bass heavy and muddy. But online I read a review of AudioEngine 5, a pair of "ipod speakers" that got fabulous reviews—from audiophiles.
You probably know that audiophiles are nutcases, but there is something to be said for their discrimination and knowledge of the art. If an audiophile says something is good, then it probably rocks if you're a normal person, even a musician like me. So, I found a deal and bought the A5s for $350. And I picked up an Apple Airport Express at the same time.
Both purchases turned out better the more I learned. The A5s have built-in amplifiers, which means that I don't need to (a) buy an amp (which I planned) or (b) match the amp to the speakers. That's a relief because sound matching amp/speakers would be a LOT of work. With the Airport Express, I started to notice something odd. When I plugged my MBP directly into the speakers, it sounded OK. But when I played through the Express, it sounded GREAT. Turns out the Express has a quite good DAC inside. Sweet! The improvement is highly audible.
OK, a little digression here about speakers. Most products, you get what you pay for. Not with speakers. Speakers are in fact somehow immune to the whole mass production economics. Most audiophiles seem to agree that most, or perhaps all, consumer grade speakers are absolute shit. To get good speakers you either spend absolutely boatloads of money, buy second-hand, or ... you can buy from very small companies, even individual crafters. Audioengine falls into the last category. Even though their website may look slick, this is a small enthusiast company that just wants to make great speakers.
What's up with that? I don't know. I think partly it's the analog ecosystem. For good analog components you just cannot avoid spending a lot of money on expensive electronics to put inside. You can't skimp or replace things with digital. You have to have huge capacitors, big transistors, lots of coiled wire, heavy metal. Good speakers are HEAVY. They are made not from plastic or even titanium but MDF—that's plywood in normal english. You can't fake this stuff, you have to have it, but it's not rocket science, just good workmanship. So, buying from a small company like Audioengine is not silly, it's a great choice. End of digression.
So... now I had a REALLY good sound system and spent countless hours discovering all kinds of wonderful things about my music collection. It really makes a difference. In fact, I admit that I've poisoned my ears on lesser systems... I just need to hear the higher quality. The music is just ... better. There's more in it, detail wise, spatially, musically, tonally. Get a good pair of speakers & DAC, and you too can discover the magic.
Next up: TV. Starting out, I thought I wanted the biggest plasma I could buy. I read all of the reviews, the dark room tests, HD movies, the works. Plasma is the best, blah blah blah. Went to a big store and suddenly I realized different. Two things for me. One: I'm only about 8 feet from my screen and I don't want to be dwarfed. So, I can knock down the screen size dramatically, in fact, I went down to 32 inches. Crazy eh? Second: I have a sunny upper-floor viewing room with a window directly opposite the display, and I intend to watch during the day. That means matte screen which means LCD. Benefits are that I save money due to the small size, don't have to worry about burn in or wasting power, and I know what LCDs are like from long experience. So I wound up with the Sharp AQUOS 32D64U. This model has 1080p, which was essential for me. I have to be future proof. It's going to be a long time before there's a higher resolution than that for films.
Finally, I need something to tie it all together, and here my Mac bias definitely played a role. Mac Mini of course. Of course it helps that they are silent, small, and look very good indeed. No ugly boxes for me. I run VLC and mplayer, but mainly Plex, and awesome port of XBMC. Video goes through a DVI to HDMI converter into the TV, and sound goes analog into the speakers (A5's have two inputs). My only complaint is again, the Mini's analog audio output is not as good as the Airport Express. Eventually I will have to buy a dedicated DAC.
This setup does everything I need, and it's got a good future. If and when I want to move up to new components, all of these pieces will make excellent secondary system components for a second room. They all go together really well, look good, and look and sound great. All told the whole system was about $2K which is a reasonable price considering that I'm basically completely satisfied at this point in time.
For the future? I might—might—try out surround sound at some point. I'm not crazy about—pointless for music, but for the movies—maybe. I definitely don't need a bigger screen. A proper external DAC, driven by USB port, is probably the next item to get, and then I would begin the search for a new amp/speaker combo. Realistically though I can't upgrade my speakers (or add a sub-woofer) until I move into a house. My apartment does not have thick walls and with the A5 bookshelf-sized speakers I can crank it up any time without waking people up.
So, there you have it... complete system, as digital as it can get, and in the $2K range. I'm happy.
Spotlight does Math (but not conversions)
Posted by Simon on December 21, 2008 at 09:56 PM
Categories: mac
Mac OS X has Spotlight (Cmd-Space) which rocks for not just finding files but launching applications (just start typing the name). I just discovered it also does math, just like google. For example, try typing in 5*9+pow(sqrt(10),3) . Nifty.
Alas it doesn't do currency conversion or unit conversions. Maybe in 10.6...?
Ruby on Rails Feed/RSS Aggregator (35 lines)
Posted by Simon on December 07, 2008 at 03:17 AM
Categories: code, rails
I wrote myself a feed aggregator for my front page. And... voila! I'm finally satisfied with it to post it.
For me I run this as a standalone rails app, separately from my weblog. You could do that (and redirect requests to / or /index.html with Apache or nginx/etc. Or you could integrate it into your own app. Up to you.
Features:
- Will aggregate ANY feed, no matter how badly mangled by the creators, using FeedTools (I also tried feed_normalizer and simple rss but they're not as good)
- Deals with slowness of downloading feeds, RSS, etc., and REXML by caching
- Deals with need to recache using elegant http/cron periodic system
- Display the feeds in a facebook-like news feed format, sorted by dated.
- You can easily re-label the feeds, add and renew feeds (in the code)
- Only 35 lines of controller code!
The heart of it is the controller, obviously. The best thing? It's only one page of code! Ruby rocks!
require 'feed_tools'
class PortalController < ApplicationController
layout 'site'
# Instructions: 1. Change @@secret. 2. Add a cron job to regularly call /?recache=yes&secret=XXXXXXX
# This is a feed aggregator that uses FeedTools because it handles practically any feed.
# But FeedTools is super slow in every way so this aggregator stops using it as soon as possible.
# TODO add XML feed output
@@secret = "change_this" # change this to protect your site from DoS attack
# The array of feeds you want to aggregate. If you change this then manually delete the whole cache.
@@uris = ['http://simonwoodside.com:8080/posts/rss', 'http://simonwoodside.com/comments/rss',
'http://semacode.com/posts/rss',
'http://api.flickr.com/services/feeds/photos_public.gne?id=20938094@N00&lang=en-us&format=rss_200',
'http://api.flickr.com/services/feeds/activity.gne?user_id=20938094@N00']
# A map between the "official" feed titles in the XML, and the titles you want to show when rendered.
@@title_map = { "Simon Says" => "Simon Says:", "Simon Says: Comments" => "Simon Says comment:",
"Uploads from sbwoodside" => "Flickr picture:", "Semacode" => "Semacode blog post:",
'Comments on your photostream and/or sets' => 'Flickr comment:' }
def index
if params[:recache] and @@secret == params[:secret]
cache_feeds
expire_fragment(:controller => 'portal', :action => 'index') # next load of index will re-fragment cache
render :text => "Done recaching feeds"
else
@aggregate = read_cache unless read_fragment({})
end
end
private
# This will replace cached feeds in the DB that have the same URI. Be careful not to tie up the DB connection.
def cache_feeds
puts "Caching feeds... (can be slow)"
feeds = @@uris.map do |uri|
feed = FeedTools::Feed.open( uri )
{ :uri => uri, :title => feed.title,
:items => feed.items.map { |item| {:title => item.title, :published => item.published, :link => item.link} } }
end
feeds.each { |feed|
new = CachedFeed.find_or_initialize_by_uri( feed[:uri] )
new.parsed_feed = feed
new.save!
}
end
# Make an array of hashes, each hash is { :title, :feed_item }
def read_cache
@@uris.map { |uri|
feed = CachedFeed.find_by_uri( uri ).parsed_feed
feed[:items].map { |item| {:feed_title => @@title_map[feed[:title]] || feed[:title], :feed_item => item} }
} .flatten .sort_by { |item| item[:feed_item][:published] } .reverse
end
end
It's actually pretty simple but it took me a while to get the balance just right. What you need to do is set up a cron job or other repetitive task that does an HTTP load on http://mywebsite.com/?recache=yes&secret=XXXXXXXX ... every once in a while. You can use wget or curl, or whatever. You might want to recache every minute, five minutes, hour, whatever. Since it's done as a part of the controller there's no nonsense about running backgroundRB, RubyCron and all the other nonsense at HowToRunBackgroundJobsInRails. Yay!
Here's the view:
<div id="feed-stream">
<% cache do %>
<%
lastday = -1
@aggregate.each do |item| %>
<div class="item">
<%
mydate = item[:feed_item][:published].getlocal
if mydate.yday != lastday
%><div class="item_details"><p style="text-align:right"><%= mydate.strftime('%A, %B %e') %></p></div><%
lastday = mydate.yday
end
%>
<div class="item_content">
<%= item[:feed_title] %>
<a href="<%= item[:feed_item][:link] %>"><%= item[:feed_item][:title] %></a>
</div>
</div>
<% end %>
<% end %>
</div>
My cache is all Hashes. I don't cache the FeedTools object because I discovered that even after FeedTools has parsed your feed, accessing the supposedly "final" data is incredibly slow (like maybe 10x or 100x slower than a hash).
Here's the model:
require 'feed_tools'
class CachedFeed < ActiveRecord::Base
validates_presence_of :uri, :parsed_feed
validates_uniqueness_of :uri
serialize :parsed_feed, Hash # note that if this exceeds a certain KB size, it will likely fail (thinking it's a String)
end
And the migration:
class CreateCachedFeeds < ActiveRecord::Migration
def self.up
create_table :cached_feeds do |t|
t.column :uri, :string, :limit => 2048
t.column :parsed_feed, :text, :limit => 128.kilobytes # use for serialized object
t.timestamps
end
end
def self.down
drop_table :cached_feeds
end
end
Well, that's all you need. When I started out to make this I thought I'd find a simple example out there but there wasn't anything. It turns out that there's a number of interesting challenges — picking a parser to deal with difficult feeds, XML, and malformatted XML... to deal with caching ... to deal with background processing. Took me a while to get it all just right.
It powers my own front page ... consider to be under standard ruby open source license. As the vending machine says: Share And Enjoy!
What Nokia needs to succeed
Posted by Simon on December 05, 2008 at 02:15 AM
Categories: theories, mobile
Making predictions is fun. I made some predictions a long time ago about the iPhone and it's fun to go back and see which ones came true. #1 was "Apple will design the plans, and they'll twist the arms of the carriers to make them simple to understand and attractive to Apple's users" — that seems to be accurate.
Now that Nokia has demonstrated that they can deliver a device to compete with the iPhone, the question is, can they deliver the rest of the solution to match? Not an easy thing to say. You need a lot more than good hardware to make the kind of great customer experience that Apple shines at.
So here's 9 things that Nokia needs to do to retain and win back their smartphone dominance.
1. Forget the carriers. Nokia has a great brand (outside the USA) in part because many of the carriers they deal with have virtually no control. They need to make the same deal everywhere, including the huge US market. When you get a nokia, it has to be a totally nokia experience. Just like iPhone.
2. In line with that, every unit sold must run the same firmware. Right now there are a zillion firmware versions for the N95 alone. This is insane and frustrating for users and developers. Everyone should be running the same version, just like iPhone.
3. Simplify product line. Again. Like Apple. Nokia has about fifty billion products on the market, all with insane numbers instead of names, and so none of them get any buzz. Names are good, small numbers of models are good. How about 3? Even 10 models would be a dramatic improvement, and probably enough to cover the gamut from $10 developing market to whatever is the highest in the range.
4. App store. Duh. BUT — this requires absolute cross-carrier uniformity and a way to ensure that every subscriber has a data plan...
5. Getting away from copying Apple here. How about they shape up their open source story? What they've started with is a good start, but it needs to be better. Developing for Symbian is just about the worst thing in the world. Apple's SDK is better but you still have to use Objective C. How about Nokia lets us code in a nice modern language like Ruby? They could really leverage open source excitement if they made that a possibility.
They can really jump the queue on Apple with this one, because OSS just goes against the grain at Apple. It's not that they don't like open source, but it doesn't work with the secrecy and the total control thing. But Nokia could leverage open source efforts to really turn their platform into something to care about as a programmer. Android is starting from scratch, but Nokia has a developer community already in place, loads of users, and all of those people would jump at the opportunity to make and use cool apps.
6. Open up the platform. If nokia is seriously about open sourcing Symbian, then they should let people go so far as to actually installing their own versions of Symbian OS on their phones. That would just rock, and the user mojo would be amazing. Of course the carriers will hate it, which is why 1. above is 1. And they'll probably have to keep key sections of the OS (radio functions probably) under control.
7. Continue the content creation story, and back it up with better web integration. Keep pushing the megapixels and the video capture, etc. But, I should also be able to, with no setup, upload my high resolution movies I make with my Nokia directly to a Nokia-branded website (or flickr, if I so choose). Not using some stupid PC tools, but directly, over my WiFi network. There's no reason Nokia can't do this, and they've already made a good start with the kick-ass Sports Tracker app/web site combo.
7. Keep converging. Turn by turn GPS navigation is good, I can throw out my garmin. Keep going! They'll naturally stay ahead of Apple because they are inherently conservative on features, not wanting to add too many, each one has to be perfect and the market mature enough. Nokia can stay ahead here. I only want two electronic devices — my phone and my PC. And hey, if I can get rid of my PC that's great (integrated projector??). Unlikely, maybe. But Nokia should aggressively continue to add core features.
8. Keep innovating form factors. Another nokia advantage to stay with. Although I admit this conflicts with simplifying the product line. Wild and wacky form factors ARE cool...
9. Keep drinking whatever they are drinking. Somehow Nokia is the most Apple-like company that isn't Apple, even though they are a massive decentralized conglomerate with no dictatorial genius at the helm. Whatever they feed their people, keep doing it.