The best kittens, technology, and video games blog in the world.

Monday, March 30, 2009

The best MP3 player in the world

My iPod nano ended its life in a hilarious accident involving my cat and large bodies of water. I wish I had recorded it, that would be my first YouTube hit. Anyway, it was time to shop for a new MP3 player. Years ago when I first bought the iPod, there was really very little decent competition. I suspected by this time it would be much greater, so I took some time exploring the alternatives. Google, Amazon, Wikipedia, and product comparison sites were all completely useless, not too surprisingly (especially Wikipedia - it always sucks at any kind of useful product comparisons), so as the last resort I asked on 4chan. Yes, that's right, I based my purchase on advice of chantards!

And I'm happy to say - Anonymous delivered! Sansa Clip is far better than anything offered by Apple in almost every imaginable way. Let's start from the basics. MP3 players are used for two activities - listening to music (usually on shuffle) and listening to audiobooks and podcasts. iPods are completely oblivious to the second use, which is very different from the first, Sansa Clip on the other hand was built with both uses in mind and it makes a huge difference!

  • Shuffle mode on Sansa shuffles only music, not audiobooks. On iPods once you had a single audiobook on it, it broke the shuffle mode and you'd get random book chapters mixed with your music. There was no workaround as far as I know.
  • Sansa has option to increase speed of audiobook/podcasts. It uses the simplest algorithm which unfortunately changes their pitch, but it's infinitely less annoying than listening to the realy slow page at which most audiobooks and podcasts proceed. Seriously, it's a huge huge huge feature.
This two alone would be enough to make avoid iPods forever, but that's far from all. Unlike iPods which follow Appless walled garden philosophy, Sansa Clip is based on open standards.
  • To connect Sansa Clip to computer a normal mini-B USB cable is used, the same as used with all digital cameras and other small equipment. So you don't need to carry a cable with you when you want to recharge it at work.
  • You can simply drag and drop files to the right directories - like Music / Podcasts / Audiobooks. No proprietary software is needed. I might complain less if iTunes didn't suck half as much as it does, but it's the worst music player and music management program I've ever seen in my life. After getting disconnected from a computer Sansa Clip reads ID3 tags from all files, what takes about 30 seconds on 8GB. An annoyance, but far lesser than iTunes.
  • In addition to MP3 other useful formats are supported - including OGG Vorbis and FLAC.
Sansa Clip also has some really cool extra features. Now to be honest I never cared about either, but they just come out of the box:
  • FM radio
  • Voice recording
It also has really nice tiny form factor:
  • You don't have to keep it in your pocket, just clip it outside
  • And in spite of the tiny form it does has a screen. iPod shuffle is such a retarded idea for anybody who ever plays audiobooks or podcasts, something that Apple completely ignores.
  • Sansa's plastic body seems much more durable, my iPod nano was scratched after first week of use, Sansa Clip doesn't have any scratches
  • It's a consequence of multiple design choices, but in the end I can adjust volume with separate volume buttons instead of the whole: take out of my pocket, unlock, adjust volume, lock, put back into my pocket ritual that I had to use with iPod nano. As different songs on shuffle will have different volume, this is something that needs to be done a lot, so it should be fast.
  • Battery seems to last a lot longer. And as I said if it's ever low, you can recharge it without any special cable.
And finally:
  • It's far cheaper. 8GB Sansa Clip is £48.91 on Amazon, compared to £97.65 for 8GB iPod nano, and £59.00 for iPod shuffle of mere 4GB. In my experience 2GB was annoyingly small for any audiobook use, and 4GB would most likely be rather smallish too. Not that iPod shuffle would be of any use for audiobooks of course.
  • You most likely don't care, but it came with one free book of your choice from Audible. Oh yeah, it's just a generic promotional URL, they don't really check if you have the player. And it lasts until tomorrow. So in case you want one free audiobook, just grab it there ;-) You have to give them your credit card details, download one audiobook in this outrageous AA format, and then cancel your subscription. You can probably think of a way to convert it to something nice like MP3 if you need to.
Now to be honest there are a few small annoyances:
  • Display turns itself off when it's not active instead of just turning off backlight. This makes it less useful as an improvised stopwatch than iPod nano.
  • Sansa doesn't display current song's total time, only time since it started. Well, now I'm nitpicking.
  • iPod's wheel was quite convenient for a few things compared to Sansa's buttons. On the other hand it was triggered very easily and so made locking and unlocking iPod all the time a necessity, and all the most common functions work perfectly on Sansa Clip. So I'd say it's more or less even.
  • iPod nano kept partial logs of what was played, so I could use them to feed my last.fm account with my awesome script. I don't know if Sansa Clip keeps any.
tl;dr version (more respectably known as an abstract) - fuck iPods, get yourself far better and cheaper Sansa Clip, especially if you listen to audiobooks or podcasts.

EDIT: One problem I had with Sansa Clip, to activate it as an Audible device to work with Audible DRM you need Windows-based Audible Manager. Audible says iTunes can activate Sansa Clip as well, but I couldn't get it working. You only need to activate it once, so it's not a huge deal. In case you didn't know it yet - DRM sucks. Oh well, that one was free, I'm probably unsubscribing anyway, I don't really feel like paying for something that's DRMed even if it's pretty cheap.

Sunday, March 22, 2009

The Joel Reddit Effect

MOKOMOKO by Nod Young from flickr (CC-NC-SA)
Back when I still cared I spent some time experimenting with various ways to promote this blog. What to write about, how to write it, where to promote it. Google Analytics was really helpful in providing raw data to work with. Actually it doesn't provide raw data, just some standard queries, raw data would be infinitely more helpful. Anybody knows where to get it? There must be some GA-like service which provides more data, right?

One absolutely brilliant technique I found was submitting links on obscure social news sites. This is extremely counter-intuitive, but you get about as much traffic no matter how popular the site is, so I got more traffic from extremely obscure ones like Joel Reddit than from extremely popular ones like Digg. I call this "The Joel Reddit Effect".

Mathematics

So you submitted your link? Assuming it's relevant and sounds interesting, what determines how many people click on it? Number of readers (by what I mean users who use the site to read, not to promote) obviously. But also fraction of readers who will see your submission. On very small site, let's say on Zeppelin Reddit (if there is one), all readers will see your submission. These sites are really tiny and we don't care much about them. On even moderately big sites, there are too many submissions for everyone to see so it depends on number of other submissions, and on how fair the site is to your submission.
  • Impact ~ Readers · Fraction of readers who see your submission
  • Fraction of readers who see your submission ~ Fairness / Submissions
  • Submissions ~ Readers
  • Impact ~ Readers · Fairness / Readers ~ Fairness
So surprise surprise - past really tiny sites, total number of readers has nothing to do with impact. What's the Fairness factor then? On most small sites nobody is SEOing, so all submissions are pretty much equal. You need a cool title to get any clicks of course, but that's pretty obvious. On big sites like Digg clicques and SEOers monopolize the main page, so chance of normal interesting content getting to the main site are extremely slim. In the end you should expect more traffic from Joel Reddit (high Fairness) than from Digg (very low Fairness).

How to increase your traffic? Submit to as many obscure social news sites as you can.
For example I submitted post about Aumann's theorem to Psychology Reddit as it seemed to me most appropriate, and Redditors there found it quite interesting. And I've found out that llimllib submitted to to Cogsci Reddit, as he consider it more appropriate. In the end I got twice as much traffic. I often see traffic from sites I've never heard about - someone decided to submit my posts, and the traffic followed.

This model is only really applicable to Reddit/Digg-like sites; Delicious, Stumble Upon etc. follow completely different rules.

Sunday, March 15, 2009

How Robin Hanson increased my conviction that healthcare works

Badass Hana by Chrysophylax from flickr (CC-NC-SA)Divide asked in comments to my post "Which crackpot cult to join" why I didn't make any snarky remarks about Eliezer and the rest of the Overcoming Bias crew. Well, here they come.

One of the most peculiar beliefs shared by the Overcoming Bias crew and most of the readers (as estimated by the comments) but hardly anyone else is "Aumann's agreement theorem", which informally says:

If two people are perfect Bayesian rationalists, they cannot agree to disagree.
Like most Bayesian theorems it's mathematically flawless, the problems start when you try to apply it to the actual world. The bastardized version which is really popular on Overcoming Bias is:
After discussion between two non-perfect Bayesian rationalists, their views should be expected to be closer to convergence than before.
It sounds quite reasonable - the more pro-X person shared some pro-X evidence, the more anti-X person shared some anti-X evidence, and how could knowing some extra pro-X evidence could possibly make you more anti-X than before or vice versa? At worst it will make no difference, unless someone was really horrible at discussing.

Still with me? Great! Now let's apply that to Robin Hanson and effectiveness of healthcare. As you might already know if you're a regular OB reader, Robin Hanson believes that healthcare spending is largely wasted and ineffective, he also blogs about it a lot. So according to bastardized Aumann's theorem after reading some of his posts I should be less convinced about healthcare than before, right? Yet it had the opposite effect on me, and I believe my reaction is rationally Bayesian.

Discussion is not random evidence seeking

The problem with bastardized Aumann is that it models discussion as evidence discovery. If I did random research and found out result more consistent with healthcare not working, this would indeed make me less convinced about efficiency healthcare. But discussion is not unbiased evidence discovery! Here's a model I like a lot better:
  • P(healthcare works) = 50% - or any other number, it only matters in which direction it goes
  • P(Robin skillful at discussing) = 90% - I have little reason to suspect lack of skill on Robin's part
  • P(good evidence against|NOT healthcare works) = 90% - if it doesn't work, there should be some good evidence against it
  • P(good evidence against|healthcare works) = 10% - if it works, there will probably be no good evidence against it working, weak evidence will almost certainly exist
  • P(Robin's posts convincing|Robin skillful at discussing AND good evidence against) = 90% - if good evidence exists, and Robin is skillful enough, he will most likely use it correctly and his blog posts will most likely be convincing
  • P(Robin's posts convincing|NOT Robin skillful at discussing OR NOT good evidence against) = 10% - if good evidence doesn't exist, or alternatively Robin fails at arguing, his blog posts will most likely not be convincing
It's just a simple Bayesian network. The only direct observation I have is P(Robin's posts convincing) being false. I find his arguments extremely weak, the kind that I might care a tiny bit about if I found them randomly, but ones you can nit-pick about pretty much anything if you look long enough. Now let's see how it updates my posterior probabilities.
  • P(Robin skillful at discussing|NOT Robin's posts convincing) = 83.3% - down from 90%
  • P(good evidence against|NOT Robin's posts convincing) = 16.7% - very significantly down from 50%
  • P(healthcare works|NOT Robin's posts convincing) = 76.7% - significantly up from 50%
So reading failed arguments against healthcare, I believe more in healthcare, contrary to Robin's intentions. If I didn't really believe in Robin's discussion skills (10% instead of 90%), updates would be very small, but still in the same direction:
  • P(Robin skillful at discussing|NOT Bad Robin's posts convincing) = 5.8% - down from 10%
  • P(good evidence against|NOT Bad Robin's posts convincing) = 47.7% - slightly down from 50%
  • P(healthcare works|NOT Bad Robin's posts convincing) = 51.9% - very slightly up from 50%
I'm not really going to discuss particulars of the healthcare case, but the general heuristic is:
If someone who's good at convincing tries to convince you about X and fails, it is a good evidence against X.
This effect is only strong when you have reasons to believe convincing arguments would be used. If you expect appeal to emotion or other low value arguments (like when a politician speaks to uneducated voters), and get it, it's really low evidence (but still against). If you expect to get strongest arguments available, but get something very weak, that's some very good evidence against.

Friday, March 13, 2009

Medieval 2 Total War Concentrated Vanilla 0.04

Peggy's Birthday Cake by the-icing-on-the-cake. from flickr (CC-NC)Here's another release of Concentrated Vanilla minimod.

A few iterations of playtesting went into it. Sieges should now hopefully be more balanced and a lot more fun. All changes related to sieges and battles:

  • Towers and are always manned as long as there's any unit behind the walls they're on. In multi-walled settlements you need to be within proper walls.
  • Rams are at 50% attack and health.
  • Walls and gates have 4x the strength. Towers have only 50% extra strength, but because they're always active you will want to actively destroy them instead of just scaring the AI away from them to deactivate.
  • Towers have 50% faster fire rate.
  • All missile infantry has twice the ammo, so they can defend settlement easier, and are much more effective skirmishers against heavy infantry not supported by cavalry.
  • Bodyguards are half the size and 1hp only. Having cheap and extremely strong heavy cavalry that early basically made all factions the same, nerfing bodyguards makes factions a lot more different again.
It all increases value of artillery (for siege attack), heavy infantry (for siege attack and defense), missile infantry (for siege defense and skirmish), light cavalry (as cheap anti-skirmisher force), and actual heavy cavalry units (because you cannot rely on bodyguards). Light infantry can be used more effectively as cheap but effective settlement defense, and using spies to open gates and protect against other spied doing the same are more important. Missile cavalry doubles as anti-skirmisher light cavalry and cheap skirmish troops. Bodyguards are massively nerfed. This all makes battles more interesting, especially sieges.

Campaign changes are mostly to make campaign more dynamic, make money important again, and reduce micromanagement:
  • Everybody moves 75% faster. That's about the right value for the vanilla map. I wanted to make ships 100% faster but land units only 50%, unfortunately it's not possible the way M2TW is implemented.
  • Taxes have twice the effect on population growth. Low = +1%, high = -1%, very high = -2%. No longer is "as high as possible without getting riots" the best tax strategy.
  • Resources are 50% more valuable, so trade, merchant trade, and mines are worth more.
  • All buildings take 1 turn to build. It's now about money.
  • All buildings except for mines are 20% more expensive.
  • Mines are 3x more valuable, and cost 80% more money. It makes them hugely important.
  • Rebels and pirates spawn 4x less often, it seems to make them a lot stronger when they actually spawn.
It really makes vanilla a lot more dynamic - because units are faster you no longer have to attack the closest settlement mindlessly, you can invade Venice from Egypt if you want to. As resources and especially mines are now a lot more valuable, and big cities can be developed with money, importance of particular cities is massive. In vanilla a settlement is a settlement, as long as it's close enough to ship armies there, in Concentrated Vanilla a good city is worth starting war for, no matter how far it is from you. And they're also much harder to take, especially well-manned bigger cities, Fortresses, and Citadels, making it all far more interesting.

Here's download link to the most recent version 0.04 . You can also get older versions if you want.

Sunday, March 08, 2009

Use Greasemonkey to vote for hotter girls

The Thinker... by law_keven from flickr (CC-SA)

Tell me - are there any websites that you enjoy a lot, except you're really pissed about some tiny quirks? I mean, other than ads, you already know how to fix those. Don't even think about contacting website author, that almost never works. Better take the matter in your own hands, and write a Greasemonkey script to fix the problem.

Greasemonkey scripting is not too popular, because nobody knows how to do it. There's a manual online, but if I publicly mention what I think about it, Mark Pilgrim will never speak to me again, and that would be bad.
Fortunately you don't have to rely on it any more - taking advantage of immense popularity that this blog occasionally has (hey there programming reddit! vote buttons under post), I want to singlehandedly empower all of you - and tell you in easy and zero-bullshit way how to make the Internet a better place with Greasemonkey.

Preparations


First, you'll need Firefox obviously. Install and enable Greasemonkey and Firebug. Restarted Firefox? Great!

Now open Error Console. Yes, I know you have Firebug, but it won't catch errors in your Greasemonkey scripts, you need Error Console for that.

Go to website you want to fix, let's say hotornot, right click on the monkey, select "New User Script...", fill in name, namespace, description, and URLs on which it should be executed (usually http://www.domain.com/* - remember about the *) add alert("im in ur greasemonkey, makin internets better"); below the comments block, something like that:
// ==UserScript==
// @name           My new script
// @namespace      http://hi-thats-me.blogspot.com/
// @description    Increases general awesomeness levels
// @include        http://www.hotornot.com/*
// ==/UserScript==
alert("im in ur greasemonkey, makin internets better");


Now close text editor and reload the page. If you've done it right, you should see the alert box. Congratulations, you've just written your first Greasemonkey script!

The secret step preceeding profit


Now here's my problem with Greasemonkey and its documentation. Do you remember how hard it was to do anything useful with Javascript in 2000? Now multiply that by current value of Dow Jones Industrial Average because of security sandbox and no control over HTML, and that's about how hard it is to write Greasemonkey scripts official style.

Fortunately you can almost use modern Javascript within Greasemonkey. What you need to do is get jQuery source and copy and paste the entire file just under your Greasemonkey script's initial comment block.

We're almost there. Now the second part of the secret step:
unsafeWindow.jQuery = jQuery;


For security reasons Greasemonkey scripts execute within a sandbox. So jQuery which you just included won't be available to script on the page. That's not normally a problem because they're someone else's script, except that Firebug executes it their context, not Greasemonkey context. So if you want to develop your scripts with help of Firebug, you need this line.

The unsafe part suggests there's a security risk involved, and there might be some. Javascript on the page is not supposed to be able to manipulate Javascript within your Greasemonkey script, but now it has limited access to your sandbox. There's probably some way of abusing this access and owning your machine, so just comment this line out after you're done developing.

Profit!

And now profit time. All photo voting websites want you to click on numbers or photos to vote. That's outrageously bad usability, and even in Web 1.0 you should be using keyboard for that. So let's fix it.

Right click on the monkey, select "Manage User Scripts...", select your script for editing. It should look something like this:
// ==UserScript==
// @name           Hotornot vote by keyboard
// @namespace      http://t-a-w.blogspot.com/
// @description    Use 1-0 to vote
// @include        http://www.hotornot.com/*
// ==/UserScript==

// Content of http://jquery.com/src/jquery-latest.pack.js goes here

// Use only for development:
unsafeWindow.jQuery = jQuery;

// and here's out script
Now we need to intercept keypresses on the entire window. We should return true if we want propagation or false if we intercept.
jQuery(window).keypress(function(ev){
// logic here
return true;
});


For hotornot we want to use keys 1 to 0 (0 being 10).
jQuery(window).keypress(function(ev){
  var cc = ev.charCode;
  if(cc >= 48 && cc <= 57) {
    // vote here
    return false;
  }
  return true;
});


Now let's vote. hotornot's HTML isn't the prettiest ever, but we can handle it. We're interested in form named voteForm, votes are checkboxes located in divs r1 to r10.

jQuery(window).keypress(function(ev){
  var cc = ev.charCode;
  if(cc >= 48 && cc <= 57) {
    var vote = cc - 48;
    if(vote < 1) vote = 10;
    var check_box = jQuery("form[name='voteForm'] div.rateval#r"+vote+" input");
    var form = jQuery("form[name='voteForm']");
    return false;
  }
  return true;
});


Unfortunately due to security sandbox we cannot use all of jQuery power, so we'll have to use a mix of jQuery and DOM scripting. It would be brilliant if Greasemonkey, jQuery, and Firebug all worked together, but so would be peace in the Middle East.

jQuery(window).keypress(function(ev){
  var cc = ev.charCode;
  if(cc >= 48 && cc <= 57) {
    var vote = cc - 48;
    if(vote < 1) vote = 10;
    jQuery("form[name='voteForm'] div.rateval#r"+vote+" input")[0].checked = true;
    jQuery("form[name='voteForm']")[0].submit();
    return false;
  }
  return true;
});

Done.

BabeVsBabe


BabeVsBabe is a less popular photo voting site, but girls there are much prettier than on hotornot, and selecting if left or right are hotter involves much less thinking than selecting a number vote.

Let's start with the same skeleton:
// ==UserScript==
// @name           BabeVsBabe vote by keyboard
// @namespace      http://t-a-w.blogspot.com/
// @description    Use left and right arrows to vote
// @include        http://www.babevsbabe.com/*
// ==/UserScript==

// Content of http://jquery.com/src/jquery-latest.pack.js goes here

// Use only for development:
unsafeWindow.jQuery = jQuery;

jQuery(window).keypress(function(ev){
  // code goes here
  return true;
});


The main difference is that we want to intercept left arrow (key code 37) and right arrow (key code 39) keys, and both possible votes are conveniently located in separate forms named frmLeftBabe and frmRightBabe.

jQuery(window).keypress(function(ev){
  var kk = ev.keyCode;
  if(kk == 37) {
    jQuery("form[name='frmLeftBabe']")[0].submit()
    return false;
  }
  if(kk == 39) { // right
    jQuery("form[name='frmRightBabe']")[0].submit()
    return false;
  }
  return true;
});


Save, reload, and spend as much time enjoying Greasemonkey usability improvements we just did as you want.

Upload your script to userscripts.org


Writing a great script is only half of it. After you have written it, you should share it on userscripts.org.

Full scripts described in this post are here: hotornot script, babevsbabe script.

Moar!


There's plenty of things you can do with Greasemonkey scriping. If you just need something to train on, I recommend Kitten War. If there's enough interest in this, I'll write more posts explaing how to deal with, I'm open to suggestion what to improve next.