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

Saturday, October 26, 2013

Some things beemind better than others

Winy and her water by Tambako the Jaguar from flickr (CC-ND)

I'm in the middle of long overdue full GTD review, and one thing I've noticed was that aspects of my life that have a Beeminder goal connected to them tend to do a lot better than those that don't.

This doesn't necessarily mean it's thanks to Beeminder - there's also a lot of reverse selection, since only things I have clear goals and metrics for can really go to Beeminder, and that alone usually means they might go better, but it sure is a suggestive correlation.

What doesn't work too well on Beeminder

Anyway, I'm in the process of archiving one goal. I was very reluctant to add it, and pretty much all my worries about it were confirmed. It was a "do less" goal to try 80% paleo diet I wanted to try for a while. Now the goal was never in any danger of derailment, but it felt really wrong all the time.

A "do more" goal is something you need to think a few times a week, requires minimal data collection, and all that data collection corresponds to a successful outcome on the graph - you're getting some awesomepoints! You need to think about it sometimes - but vast majority of your time you can completely ignore its existence.

A "do less" goal on the other hand is something looming over you 24/7. It requires constant tedious data tracking (I only sent daily summaries to beeminder, but total number of data points collected for it was much higher than for all my other goals combined), and is associated with negative rather than positive emotions all the time you collect data for it. There are no redeeming qualities here.

About the only thing worse than a "do less" goal would be a weight loss one - not only you get all the negatives of a "do less" goal, you don't even have any reasonable amount of control over the outcome.

Now I never bothered to look at Beeminder's data to see if "do more" goals have higher success rate than "do less" and "weight loss" goals, but I'd be surprised if that wasn't the case. And even if they don't, they're sure much more fun and less stressful.

As for paleo diet in particular, it's fine when you can cook at home, but it's rather impractical otherwise without seriously stretching definitions of what counts as "paleo". There's huge choice for people who for some reason want industrial waste from soybean processing and similar garbage (also known as "vegans"), but if you want real food, you're on your own. Maybe it will change one day but for now full paleo is just too much effort and the best one can do is avoiding the worst of industrial crap.
Yawning tiger cub II by Tambako the Jaguar from flickr (CC-ND)

Goal Status

I don't really have any hard long term targets - I adjust them based on how difficult it currently is and how important I feel the goal is - if the goal is important but current target is too easy that's a good reason to ramp it up.

Anyway, goal status, from hardest to easiest:
  • Try new fun things - That's a new goal I added recently, so it has no data points yet. I'm not really worried about meeting this goal, but it sure is fun to get some points for things I want to do anyway (2/week).
  • Pomodoros of important things - Another new goal. Initial target at 7/week, but it will need to go a lot higher once I get used to it. I have a lot of projects I want to move forward without good goals or measures, so rather than ignoring them or adding 20 or so separate goals of dubious quality, I'm adding a catch-all "pomodoros spent on doing any of them" goal (anything covered by another goal doesn't count here). This might still end up leaving half of the projects without any significant progress, but that's better than all of them. 
  • Exercise - This goal has been suffering from serious difficulties. Early on I managed to get sick, last week my exercise equipment broke down (fortunately ebay was pretty fast as shipping replacements). I'm about right on track for 3h/week target, and I might consider increasing it to 3.5h/week someday, but for now I'm just going to stick to current target.
  • Online Education - I found a lot of resources other than Udacity, so this goal is safer long-term than I was originally worried. I still feel it's relatively hard to find quality resources in subjects that interest me, and in a few months I might run out of them, but for the time being 3 lessons/week is just fine.
  • Play Magic - No troubles here, but I don't feel any major reason to ramp this up from 10 games/week.
  • Open Source contributions - This has been going surprisingly well, and I'll soon post about some of the things I've been working on, and since this is really important I'm going to increase the rate from 7 commits/week to 10 commits/week.
  • Blog posts - It seems I accidentally wrote a post that got into top 10 of this blog ever just a few days ago. It's so random which posts become popular and which posts almost nobody reads... Anyway I've got ton of things I want to write about, and I really like this blog being much more active, so I'm increasing the target from 2 posts/week to 3 posts/week.
  • Books - I feel a bit like a Soviet factory manager here since I went through my list of things to read, sorted by shortest first, and I'm focusing on these first. But then correlation between length of the book and its intellectual value is not that high, so it's a totally reasonable behaviour. I'm going to increase the target from 2/month to 3/month since I still have a huge stack of things I want to read, and it's going to take me years to get through it no matter the target.

Future goals

There's a lot of things I want to improve, but they don't have obvious good goals. I tried a dubious goal with paleo diet, and that didn't go too well, so I'll stay away from other "do less" goals.

Doing new fun things sound like a good catch-all goal to make sure time spent having fun still feels like achieving something, and it's important to have some balance in life. Goals are self-correcting, since ones that have lowest "days until derailment" feel most like an achievement to focus on, so there's no worry I'm just going to play new video games all time next month for some nice points.

Another area that really benefits from adequate focus, and which I often got bad at taking care of in the past is maintaining my GTD system. Unfortunately none of the metrics are sensible - my GTD inbox will invariably go way above 0 (and likely >200) since I tend to do reviews using "dump everything into inbox, then dump all my thoughts into inbox, then process one item at a time" system and it can take a long time to get it together. Even not counting reviews inbox often gets temporarily flooded by new content, and that's perfectly fine, as long as it all gets processed within reasonable time. I have no idea what to do about it all.

Of all the projects currently covered by "do more pomodoros" goal - some of them might end up having their own goals if I can come up with any, or they might just get completed or blocked for longer time (another reason why I don't want to put them all onto separate goals). I'm not sure if the pomodoro goal will really work or not. If not - I'll have to come up with some other way of ensuring these things are moving forward.

See you next time.

Friday, October 25, 2013

Recommended Sublime Text configuration

102503666.jpg by The Consumerist from flickr (CC-BY)

Turn on Sublime Text, go to user configuration, press Cmd-, (or Ctrl-,) to go to User preferences, delete whatever was there before, and just copy and paste this:

{
  "ensure_newline_at_eof_on_save": true,
  "show_full_path": true,
  "tab_size": 2,
  "translate_tabs_to_spaces": true,
  "trim_trailing_white_space_on_save": true,
  "word_wrap": true
}


OK, now explanations.

First and most important - "tab_size": 2 and "translate_tabs_to_spaces": true enforce 2 space indentation default. As civilized people living in the 21st century we shouldn't be indenting with tabs like animals! Note that I didn't override "detect_indentation": true, so if you open a file with screwed up indentation already, Sublime will use that file's indentation within it, no matter how wrong. This only applies to new files.

Next "ensure_newline_at_eof_on_save": true and trim_trailing_white_space_on_save: true normalize whitespace in your files, reducing unnecessary version control conflicts, especially if everybody uses settings like that.

"word_wrap": true enables word wrap for source files (by default it is on for plaintext files, but off for source files). There are some formats like .feature which work better without word wrap, but for 99% of sources word wrap is the right thing to do, and even two 2560x1600 monitors don't provide enough screen real estate to always be able to expand all lines fully.

The last setting you'll need is "show_full_path": true. This is a fix for OSX's stupid idea of only showing fill name in title bar, instead of full path. Far too often multiple files in your repository will have the same file name, and full path is the only way to tell them apart quickly, and without this title bar is basically wasted space.

That's it for today. Coming next: a book on how to configure Emacs.

Script to check total time of your media files

dia mundial do rock by deadoll from flickr (CC-NC-SA)

I download a huge ton of podcasts, audiobooks, and youtube videos for watching on the train or listening while shopping or exercising (since this time is pretty unproductive otherwise), and one thing that annoyed me was lack of simple tools to check how many hours of content I actually have left.

So here's the most recent addition to my collection of Unix utilities - media_size.

Usage is really simple:

    $ media_size some_directory/ another_directory/

The script uses exiftool utility internally, and between exiftool and some hacks it can deal with most of the media files. There are still ones that it can't do, so pull requests definitely welcome.

Tuesday, October 22, 2013

Longest chain of strictly better Magic cards

Some Magic cards are "better" than others in vague sense. Some are even "strictly better" - that's a narrow concept for a card that is preferable to another in just about any "normal" game situation - due to more powerful effect, more flexibility, lower or easier mana cost etc.  at no downside.

For creatures this also means the "strictly better" version should have at least the same creature types, but more creature types are usually fine (so Zombie Knight is strictly better than Zombie, other things being equal) - but then I guess it's fine to ignore creature types that don't carry any bonuses whatsoever (so Alloy Myr is "sort of strictly better" than Opaline Unicorn - since there's no card that gives bonuses for Unicorn creature type).

There are some cases where you'd actively want to play a "strictly worse" cards, but they are pretty unusual. For example a removal spell that can't target Spellskite would be preferable to one that can, and in a devotion deck you might prefer the same creature for GG cost over 1G and so on, so no card is "absolutely under any circumstances better" than any other, but "strictly better" is still useful as a concept.

So an interesting question comes to mind - what's the longest chain of strictly better cards you can come up with?

With help of user Felicia_Svilling from reddit, here's a 5-card chain of strictly better cards. I don't think this can be beaten, but then I might be wrong.

The first card in the chain is a strictly worse version of Cancel. It in an instant, not a sorcery in Oracle text. Portal cards were funny like that.
The current low-power version of counterspell. They print strictly better versions of this card in just about any block.
This one fits the chain really nicely since it's a Cancel if you don't have metalcraft and Counterspell when you do.
Counterspell - the pre-nerf Cancel.
And the final part of the chain. Ironically it was originally not strictly better than Counterspell. Back when it was printed mana burn existed, so you might be unable to spend all that mana, and it could even kill you. Without mana burn, it became strictly better.

Can you come up with a longer chain, or even another 5-card chain?

Friday, October 18, 2013

Akrasia Theory and Beeminder update

risky game by mathias-erhart from flickr (CC-SA)

So this post will be about two only loosely related things - some problems with akrasia theory and my Beeminder status update.

Akrasia Theory

First, akrasia theory. The theoretical underpinning of it is that humans and animals for that matter use "incorrect" and time-inconsistent hyperbolic discounting instead of much more "correct" and time-consistent exponential discounting.

This is extremely problematic from evolutionary point of view - since any animal that moves even one bit closer towards "correct" discounting models could be massively more successful than ones that use "incorrect" models.

There's a bunch of ways to deal with this issue. A hopefully exhaustive list would be:
  1. Exponential discounting is more correct, but brains cannot implement exponential discounting even in principle
  2. Exponential discounting is more correct, brains can implement exponential discounting in principle, and it would be major evolutionary advantage, but in never evolved yet
  3. Exponential discounting is more correct, brains can implement exponential discounting in principle, but it wouldn't bring major evolutionary advantage
  4. Hyperbolic discounting is more correct
The first of these is just extremely problematic. Bounded rationality is fine, but exponential discounting is mathematically extremely simple, and it's hard to come up with any argument why it would be even tiny bit more complicated or difficult to implement than hyperbolic discounting - something even tiniest animal brains seem to have no problems with. Hyperbolic discounting has a small advantage that natural scale for most things is logarithmic, not linear, but we can think about linear scales if we want to. What's worse - if we accept that linear scales are impossible to think with, that completely destroys any chance of game theory or any other mathematical theory of mind working - and nearly 100% of things evolutionary psychology postulates are far more complex than that, so we'd have to reject them all a priori (I'm quite willing to reject most of them for this reason anyway, but not to such extreme).

The second alternative is actually somewhat promising, since we know of huge number of extremely successful evolutionary traits that evolved only once, even though nothing obvious prevented them from evolving much earlier. Like basically everything humans do. Even simple things like ability to synthesize all essential vitamins is entirely possible in principle, and it would be advantageous to organisms that lost it (which is all animals, pretty much) - but once organisms lost such ability, they never regain it. Still, it would really deserve some explanation why this is a particularly difficult thing to evolve into, and it's hard to come up with any.

The third alternative is probably the most popular (just after pretending the problem doesn't exist) - sure, exponential discounting would be better, but then animals' decision processes are based on duct taping huge number of silly heuristics together, so whatever problems hyperbolic discounting causes have been papered over by other biases and heuristics anyway, so it's not a big deal outside completely artificial laboratory conditions. It's difficult to come up with a convincing counterargument against this. It forces us to abandon all mathematically simple of human or animal behaviour, but these were totally silly in the first place anyway.

The last alternative is something that almost nobody except me seems to take seriously, and perhaps they're all right, but maybe - just maybe - animals use hyperbolic discounting because it models the real world better than exponential discounting? The thing is - exponential processes despite their mathematical simplicity are nowhere to be found in the nature. Even radioactive decay - the classic example of exponential process - looks much more hyperbolic once you move from a single element to a mix of elements (or include secondary products of radioactive decay in the distribution). I have no way to prove it, but it definitely feels right, and avoids completely ridiculous conclusions that come from taking exponential discounting seriously.

sleeps with bees by splityarn from flickr (CC-NC-SA)

Beeminder Update

Anyway, here's my regular Beeminder update. My 6 "do more" goals, even after previous ramp up got to average of 34 days until fail, which basically means Beeminder is currently completely toothless. So far it looks like I'm not going to pay them a single dollar ever, but then who knows.

I feel it's important to distinguish between target levels (I wish to do X/week) and commitment levels (I commit to do X/week). Commitment should be much lower than target. By how much depends on variance - for low-variance goals like exercise they can be pretty close, for high-variance goals you should commit to much less than you target, at least initially. If it works, you can always increase commitment levels.

Goal status, from hardest to easiest:
  • Exercise. It's going most smoothly of all goals. I'm going to increase it from 2.5h/week to 3h/week commitment (current average is 3.4h/week). All this is in wii fit / ddr "minutes", and 3h of such "minutes" is actually about 3h45m wall clock time. I have no plans to ever commit myself to anything more than that, since there's only so much time in the week and there are diminishing health benefits to exercise. If that's ever too easy I'll just increase exercise intensity instead.
  • Online Education. I found a bunch of alternative resources since then, so it's not just Udacity now. The problem is conversion factors between them, and I'm taking a fairly generous interpretation here that full unit is full unit, even if most are much easier than Udacity's GPGPU course. I'm increasing this from 2.5/week to 3/week, and I might increase this again in the future, depending on what other education sources I'll find.
  • Play Magic. I could easily increase the commitment to play 10 games/week, but that's a good number and there's no reason to overdo it. I'm definitely playing enough to stay up to date with all the developments in the game, and I'll explore other formats some more once I get bored with Theros Standard.
  • Open Source. This is going really well right now. I feel this is extremely important, so I'm just increasing it from 3 commits/week to 7 commits/week. This might increase further, depending on circumstances.
  • Blog. My blogging has been really active recently, and I plan to keep it this way, so I'm doubling the rate from 1 posts/week to 2 posts/week. This also might increase a lot more.
  • Books. There's a big problem of what counts as a "book" here, since some are a lot longer than others. I'll be going through a ton of audiobooks for exercise anyway, and still I have a ton of paper and Kindle books to read in addition to that, so I'll increase it from 1 book/3 weeks to 1 book/2 weeks to maybe get through all these stacks someday. Perhaps I'll change this goal to count shorter books for less and longer books for more someday? We'll see.
I also have a bunch of things I want to measure but I don't yet feel like committing to them on beeminder. I added one of them - a "do less" goal to give 80% paleo diet a try, and so far it's going quite well. The biggest position on the non-paleo budget is unsurprisingly coffee, which just isn't particularly good without sugar, milk, and chocolate, and considering my coffee requirements and realistic off-paleo days for external reasons I doubt I'll be tightening that 20% non-paleo allowance anytime soon. To be honest I haven't noticed any interesting effects from that, other than it forced me to try different things in the kitchen.

As for my other non-beeminder measures, two of them are reasonably on-track, and one is very much off-track. No idea if I'm going to commit to them or not anytime soon, but I'm thinking about it.

Wednesday, October 16, 2013

Review of Save the Cat by Blake Snyder


Feline: In Repose by Jason A. Samfield from flickr (CC-NC-SA)
"Save the Cat" is a guide on how to be a successful screenwriter in Hollywood. As you might have guessed, I have no such ambition myself, but it's always interesting to get some basic idea what it's like in different parts of the creative world.

The book is extremely focused on practical matters. It gives you minute-by-minute breakdown of what is supposed to happen in a movie when, exactly what plot devices are necessary in what kinds of movies, how to structure each scene with mandatory emotional change and conflict, how to entwine primary and secondary story, how to write, how to pitch your screenplay and so on.

Normally you'd expect similar books to be really vague and full of banal generalities, with maybe a small sprinkling of practical advice. Save the Cat is nothing remotely like that - it's extremely content-dense and provides a framework that seems to be ridiculously specific. In a way, it reminds me of Getting Things Done - another short book with extremely specific framework, that stands completely apart from the ocean of feel-good vagueness which is productivity books.

Anyway, the book is supposedly all the rage in he Hollywood, and I can totally believe that. The problem with it is that  it looks like a really good guide to making totally mediocre movies.

The author - Blake Snyder - is supposedly a huge screenwriter star, but what is his actual filmography? Here's the complete list:
And that's it! So basically he's a talentless hack as far as screenwriting goes, and all his life's achievements seem to be two godawful movies, and yet somehow making millions selling ton of screenplays (none of them ever getting made into movies), and convincing the entire Hollywood that his way is the one true way to make movies. No wonder I like so few movies these days.

Now the book is really nicely written, and its advice might be extremely helpful to new screenwriters for all I know. At least some of the advice rings true, but then vast majority of examples he gives are from either old mediocre movies everybody already forgot about (and I've never seen) or more recent mediocre movies, some of which I've seen but can recall only vaguely. The only success criteria for the author seem to be box office sales (and both of his awful movies made about $30m each in States). If you put together all sentences about movies which were actually good, that's going to be less than a page, probably.

Anyway, it's a great book for an aspiring scriptwriter, or for an aspiring self-help book writer. For someone who loves movies, it's just too depressing.

Monday, October 14, 2013

Presentation Slides for Introduction to Data Archeology


Harley's Hat by Nick Harris1 from flickr (CC-ND)
Last week I took part in a 2-day presentation skills course ran by Christopher Bowerman from Tripos Consultants.

I prepared presentation based on my popular blog post "Introduction to Data Archeology".

In case you're interested, here are before and after slides. All PowerPoint goodness. No Comic Sans. Did it get any better in the after version (it got some content cut because it was over time, but nothing essential)?

Sunday, October 13, 2013

Crusader Kings 2 adoption and disinheritance minimod

«I'm holding you tight!» by Tambako the Jaguar from flickr (CC-ND)

That's something I've seen requested on various forums a lot, so here it is: a mod that allows anybody to adopt a vassal or courtier as their child, and to disinherit any of your children. All available in intrigue menu. (that's a bit messy interface - if someone has a better idea that doesn't require a lot more coding, please tell me)

AI never does either of these things, so they're player only.

Requirements for both are simply being adult male. Characters only agree to be adopted if their opinion of you is at least 50, and they become part of your dynasty as well (but their children stay old dynasty). Disinherited children still remain part of your dynasty, and can still inherit from their mother.

This basically means that you get to choose whoever you want as your successor.

This minimod is asking for some culture restrictions, opinion modifiers etc. from all that, but I'm leaving it bare-bones so that it can be compatible with pretty much all other mods including most total conversions.

Other game rules still apply, so oldest child (biological or adopted) is the main heir, except for born in purple and similar stuff.

This ability is extremely powerful, so don't overuse it. Oh and if you adopt a few dozen children at once that seems to freeze the game, probably due to too many sibling events triggering.

Here's download link. Have fun.

Sunday, October 06, 2013

Beeminder ramp up time

Chocolate by Alba Soler Photography from flickr (CC-NC-ND)

Ten days ago I started serious Beeminder experiment. I came up with 10 things I want to track, and 6 of them seemed sensible enough to put on Beeminder (the other 4 I'm just tracking offline for the time being, there are various complications with them, I might add them to beeminder later).

My initial goals were very conservative, and it doesn't surprise me that I had little trouble meeting them. As of writing this I'm 15 days away from failing on the slowest moving goal, and 31 days on average (some of my offline goals are doing a lot worse).

Here's a per-goal update, sorted by time to fail from hardest to easiest.
  • Online Education. That was all long overdue. It goes very smoothly, feels very useful, and I see no problem with ramping this up from 2/week to 2.5/week. I put some effort into finding out some non-Udacity courses, but it's relatively problematic what will count as a "unit" there. It's relatively hard to rush it if I ever fell behind, since most online education requires some serious homework, not just watching instruction videos. Really happy with this. I might increase it more once I'm happy with non-Udacity courses as well.
  • Exercise. That went really well. I'll only increase it from 2h/week to 2.5h/week since I'm  also gradually increasing intensity, and I don't want to overdo this too suddenly, since that would risks injury.
  • Books. It's really difficult to say how it's going to work, since I only finished one book during last ten days (on Kindle). I tried some long overdue paper books I wanted to read, and that mostly just reminded me how awful and inconvenient paperbooks are. I sorted out audiobook player on my phone, since DicePlayer kept crashing all the time and wrote a script for speeding up audiobooks just to be sure. I'll probably should just throw away all the paperbooks in my backlog, and find ebook (or audiobook) versions instead if possible. Did I mention how much paperbooks suck? Anyway, increasing the rate from 1/4 weeks to 1/3 weeks feels safe enough.
  • Open Source contributions (as counted by github commits). I set this goal very conservatively to be below my average github contributions over the last year, but it was actually very close to derailing since these tend to happen in a very spikey manner. I had 1 commit over 9 days, and 8 commits today. Since this is important, I'm going to increase the rate from 2/week to 3/week.
  • Play Magic - for a moment I was worried that UW Control and Esper Control might screw Standard completely, in which case I might find it too unfun to play for the next three months, but everything looks good now after all. This is ton of fun, so I'll just double the goal from 5 games/week to 10 games/week. It's pretty silly to have "have fun" as a goal, but why not.
  • Blog - the unfortunate thing about this goal is that it tracks quantity, not quality, but there's nothing wrong with writing more shorter posts, when the alternative is not writing at all. I'll just double the goal from 1/2 post a weeks to 1 post a week, since that doesn't seem too difficult.

Command line tool to speedup MP3 podcasts and audiobooks

Pilbeam on the piano by andyaldridge from flickr (CC-NC)
I added speedup_mp3 utility to my unix-utilities repository on github.

If your phone, mp3 player, or whatever else you use can't speed up podcasts/audiobooks enough, or it only does that while increasing the pitch, just use this utility.

It copies over important ID3v2 tags, so the files should generally be tagged correctly.

It works on Linux and OSX, you need sox and id3v2 programs installed first.

Usage examples:
speedup_mp3 -1.4 file_in.mp3 file_out.mp3
speedup_mp3 -1.5 directory_in directory_out (directory_out must exist first)

1.4 is a decent default speedup for most podcasts and audiobooks, but experiment until you find something you're comfortable with.

Wednesday, October 02, 2013

Review of Elcenia: Summons by Alicorn

Chiffon by Gattou - Lucie Provencher from flickr (CC-SA)

I really enjoy reading fanfiction, and Luminosity - two Twilight fanfic novels by Alicorn were among the best I've ever read, so I was quite enthusiastic to give Elcenia - original fantasy fiction series by Alicorn - a try as well. The main reason I didn't do that much earlier was because it's not finished, and I'd hate to wait or years for updates like it's another Game of Thrones or Order of the Stick.

Unfortunately I've been quite disappointed with it. There's a huge diffecence between writing fanfics within established world and with established characters and writing completely original fiction - even if it's "alterative universe" fanfic the author can start with established reality and characters, and spends all story points on just tweaking them a bit and focusing on the actual storyline. In Summons the author had to establish a completely new universe, a lot of new characters, create a plot, and everything else - and it felt quite flat overall.

I think the universe established in the book has a lot of potential, and it's probably the strongest aspect of the book. Both worlds are much more strongly filled by very powerful magic than a typical fantasy universe, and it includes a lot of magic of practical kinds. There are some unanswered issues here.

First - what role nonmagical people have in their worlds, if Magic can solve just about any problem easily? By comparison Tolkien-style magic is potentially ridiculously powerful but extremely rare and often quite subtle, so it causes few problems; and D&D-style magic is battle-oriented and follows "linear warriors / quadratic wizards" progress, so there are inherently very few powerful wizards, and their core competence is close to useless for solving everyday's problems not involving fighting monsters. Magic in Elcenia's setting is far more practically-oriented - but then doesn't that make pretty much all other human activities worthless? It doesn't even require any major investment of studying time to get a lot of results, that much special magical talent, or any kind of mana (other than sleep and food) - as it turns out you can become a ridiculously overpowered wizard pretty much overnight with a very simple ritual.

And second - if the act of summoning someone from another world is so trivial there, why nobody ever tried that before? Anyway, these issues are no more serious than the kind of nitpicking people can make with just about any fantasy series - and for all I know they might have good explanations somewhere down the way - and I feel that the universe is a strong point here.

A much bigger problem are characters. The book throws such a huge number of them at the reader, most with minimal characterization. The usual solution for that would be to focus on a very small group of characters first, then once the reader is comfortable with them to shift a few people in and a few people out of the focus - the kind of storytelling the first few books of Song of Ice and Fire do (then it sort of fails in books 4 and 5, especially with Meereen fail, but that's a completely unrelated issue).

Pretty much every time a character from a few chapters ago was mentioned I was completely lost who the hell was that - or even what was that character's species, gender, or home world since names are of very little help - it's fine to have completely alien naming system, but why not have some kind of gender endings and very distinct names for dragons etc. to help the reader a little? (there are some attempts at such system, but it maybe affects 10% of characters only).

That's another difference between fanfics and original fiction. In a fanfic you can throw as many characters at the reader as you wish, since most of them are known already (even if in a different version), or if not they at least fit in reader's mental image of the world somehow. If someone was described as "first-year Muggleborn Ravenclaw witch" that already gives you a huge amount of context for what they might be like, and what their relationships with different groups of characters (like teachers, racist Slytherins, etc.) might be. Or if the work takes place in a "realistic" setting, you can can usually take advantage of the tropes, and understand what it means when someone is a donut-loving fat white cop near retirement age. In original fiction in a fantasy world neither of these cluthes work, so you have to be really careful about how you present the characters so they don't overwhelm the reader.

It gets a bit better towards the end, when the rate of characters introduction slows down a bit and most get at least some action to help the reader understand who they are and what they are like.

And then there's plot... (I hopefully avoided major spoilers) That I feel is by far the weakest point of the book. There's something like five inexplicable and mostly unrelated major magical technology breakthroughs during relatively short timespan of the book, there are two romantic subplots, first of them ended out of nowhere, and then the second one started out of nowhere, charaters behave in ways that don't make much sense (going back to the point where there are too many characters but they receive very little characterization so it's impossible to figure out what their personalities are). There's also the "OMG, I must drop everything now and help the sick" subplot, which was way way more hilarious in Harry Potter and the Method of Rationality when Harry was wondering if vegetables might or might not be sentient. There are also some off-screen deaths and other major events happening with no relation to anything.

I wouldn't count any of that "unrealistic", it just feels more like we're watching a National Geographic program about Elcenia, and that's just stuff that happens to take place during filming, not like it's a real story the author wanted to tell.

tl;dr 2/5 stars. Just read Luminosity instead, even if you didn't like Twilight at all. Everybody should read Luminosity.

Tuesday, October 01, 2013

Displaying your beeminder goal status with Ruby

Taz, working on his cat loaf by DirtBikeDBA (Mike) from flickr (CC-NC-ND)
I have one rake task that updates everything that needs updating (git fetch -p and such stuff), and another that displays status of all things in progress. I want to add status of my Beeminder goals to that.

Step one is to login to Beeminder in a browser, open this URL, and copy auth token (without the rest of JSON stuff) to ~/.beeminder_auth_token.

Step two is to gem install beeminder.

Step three is the following code:
require "beeminder"

class Beeminder::Goal
  def days_to_lose
    (losedate.to_date - Date.today).to_i
  end
end

class Array
  def avg
    inject(0.0, &:+) / size
  end
end

desc "Display beeminder status"
task "beeminder:status" do
  token = File.read("#{ENV["HOME"]}/.beeminder_auth_token").chomp
  goals = Beeminder::User.new(token).goals.select{|g| g.days_to_lose >= 0 }
  goals.sort_by(&:days_to_lose).each do |g|
    puts "* #{g.title} - #{g.days_to_lose}"
  end
  puts "Avearge: %.2f" % [goals.map(&:days_to_lose).avg]
end

I monkeypatch Beeminder::Goal#days_to_lose since that's the most relevant information here. It is one higher than number displayed on Beeminder graphs, since it includes reporting day - you're not really meant to do things that extra day.

Then I add Array#avg - something that really should be in the standard library.

Then I get auth token, fetch goals from beeminder, reject goals that are already lost (one from my previous attempt forever ago), and display and average the rest.

It's all pretty straightforward, and it seems that submitting datapoints via API will also be pretty simple once I get to that.