Osmosis and the Linux Home Directory

January 20 02013 (Sunday)

I was working with the Osmosis map extraction tool today, and ran into an issue where the home directory character “~” was not being expanded:

This works:

./osmosis --read-xml file=/home/nic/us-midwest.osm [...]
This does not:

./osmosis --read-xml file=~/us-midwest.osm [...]


Time Balances Do Not Improve

April 13 02012 (Friday)

Recently, I wrote the following function (in Clojure) for my scheduler, and I think a lot can be said about it even though it’s very straightforward*:

(defn time-balance [schedule time-track excluded-items]
(- (time-until-the-end  time-track)
(time-left-to-do   schedule   excluded-items)))

In words, the surplus or deficit of time is equal to the amount of time left to do the things planned minus the amount of time that is available to spend doing things. Nothing earth-shattering per se, but:

First, time balances do NOT improve by working on things, although they can be prevented from getting worse. This can be seen by noting that if you work on something for a minute, you have decreased both the amount of time you plan to spend on tasks and the amount of time you have to get them done by one minute.

Although I made it an argument to the function just to avoid counting miscellaneous time, the excluded-items argument illustrates one approach to this conundrum: do fewer things. It’s valid and reasonable. Sometimes, dropping a low-value task is the right thing to do; in a world filled with possible activities, I don’t feel especially bad about not having chess-boxing in my schedule, since I don’t have chess or boxing in it in the first place.

Another possibility is to increase time “until the end.” I think it’s important to carefully remind ourselves of the difference between the schedule and reality. Extending my week by an extra day in my scheduler is easy enough, but this just means next week has one fewer day. The real, final end is mostly independent of most tasks you might spend time on. Life extension activities might improve your overall time balance, and this is the source of my interest in the area and support of projects like SENS, but there are limits to what can be done by an individual.

I began by supposing that there’s some amount of time you want to spend on a task, but this might not be true. Instead, it’s likely you’re reasoning backwards on a task from something you want to the amount of time you’ll need to spend to acquire it. This leads to another way to improve a time balance: increased productivity. As a simple example, I often watch videos at 110% speed, going through 30 video-minutes in slightly over 27 realtime-minutes. Few things are as easy to speed up as watching a video, however, and in a lot of areas, the best way to improve productivity is to spend time practicing — but spending time is what we want to avoid doing in the first place, so there’s a point where the productivity gain of additional practice is not worth it. Also, I find watch most videos at any more than 110% speed to be less enjoyable.

*The version of the function here has been edited for clarity, a fuller version is available.


What I Learned from Three Weeks of Tracking my Time to the Minute (Sort-of March Review)

March 31 02012 (Saturday)

Over the last few weeks, I’ve been using a small script I put together in Clojure to track my time to the minute. My friends think I’m crazy, but it’s actually been extremely enlightening, and I recommend the practice unconditionally.

High-quality focus is difficult. Very often, I’ll put something in my scheduler as my current task, and and then have to correct things later as I end up doing something else. I’ve found the the act of saying what I’m doing, even just to the computer, is helpful but not a panacea. I remain mostly skeptical of multitasking (it’s not well supported by academic literature), but I’ve found a few tasks that don’t require much attention that I can make work simultaneously. I just keep track of one thing at a time in my schedule, so whenever I multitask, I’m doing one thing that matters to my goals, and one thing that  isn’t important.

Some of the things that i thought would be big — time spent in transit from place to place — have not actually turned out to be as important as I had initially thought. I spent more time drinking tea than in transit one week by 100 minutes, and spent only 3 minutes less brushing my teeth the next. Can I spend even less time going from place to place? Yes, but there isn’t low-hanging fruit in this area. Previous optimizations by myself and “society” have worked well.

The Zeo is looking like a better and better value proposition. Out of all the tasks I’ve set targets for, I’ve most consistently gone over on sleep (even in the spreadsheet the script is based on that I worked on last month), although I hit my 10% grace and got 100% “score” the last two weeks through some improvements I’ve made to my habits. Regardless, the first week, I spent more time asleep than the next nine tasks I kept track of combined, and the next week more than the next five.

I spent too much time playing Minecraft. I recently read an article about male Australian beetles which will attempt to breed with beer bottles, as they look (from a beetle’s perspective, as far as we can tell) like impossibly sexy females. This in turn reminds me of the various articles on Less Wrong about superstimulus. I somewhat wonder if Minecraft is as popular as it is not only because it yields random reinforcement for mining and instant gratification for building and crafting, but also because of some mostly unmet need to create things in modern life. I am probably being overly dramatic; I do occasionally pick up a copy of Make Magazine or order something custom from Ponoko; here are some pictures of a root cellar i made in Minecraft:

 

 

 

I’ve found that while I can easily stick with something that’s extremely interesting and fun, if something is just interesting or merely something that I want to do, I have to make a deliberate effort. This isn’t laziness — I’ve had to make an effort to start doing things, like watching a show I’ve been following, that hardly require any effort at all to actually do (this is also an example of an area where I’ve found multitasking to be entirely acceptable).

Overall, I have used up more than the amount of time I was planning on spending on general blogging this week, and further discussion of my scheduler will have to wait for another day. ;)


February Review: Still Working on My Scheduler, Learning Clojure

February 27 02012 (Monday)

This month, I experimented a bit more with my scheduling system. I created a spreadsheet where I set aside three tasks a day, setting an equal amount of time aside for each one. Then, I scored how I did on each task using the formula:

SCORE = 1-MAX(ABS(TIMERECORDED – TIMEGOAL)-10,0)/(TIMEGOAL – 10)

Very roughly, the proportion of time I spent on a task relative to what I planned to spend on it, with a ten minute grace period. Time spent over is also considered bad, since it means I’m not doing something else. I somewhat ran into problems with this, since I was setting aside a three hour block of time each evening to work on things, which was almost always when my friends would invite me to go somewhere. My scores on days when I actually used this system were not terribly impressive, and I’m not sure if it’s just because I kept getting sidetracked or not (I was seriously ill at one point). That said, I think the biggest thing I can do to improve here is to increase my focus, so I’m going to give it another try with larger time scales during the day, with scoring across the entire week. I suspect I might be “zooming in too close”, and need to ask myself “what can I do in the immediate future” rather than “what can I do right now this hour” — hour by hour planning seems to result in me doing a lot of seemingly-good but not synergistic things that don’t actually accomplish much.

I’ve stuck for a few weeks in 4clojure on problem 104, “Write Roman Numerals” — at this point, I wish I had actually spent some time while I was studying Latin to figure out how they work, but I should honestly focus on what I want to do — learn the language — and not get caught up in something else. My goal of getting onto the top 100 list is still quite feasible (I’m currently  at 162). I also went to the Chicago Clojure meetup and was somewhat impressed by the presentations.

I finished playing Ar Tonelico: Elemia and despite the fact that it’s a paper thin vehicle for innuendo the most incredible over-the-top music in the world, I’ve gradually come around to the idea that the plot is actually remarkably thoughtful. In particular, I’m working on the first blog post for FanCruft in ages, where I’ll specifically argue that cosmospheres — the inner worlds of some of the characters — actually somewhat make sense. In a nutshell, if you had a being with a lot of spare processing power but you still wanted to interact with it in real time “like a person,” then they could use that extra processing power for an in-mind recreational world.


Bleh, 2011

December 31 02011 (Saturday)

This past year wasn’t particularly good year for me. In fairness, it was a bad year for a lot of people. First, although I moved this blog over to its new domain, I’ve neglected it since October, although I have been on Twitter. I created a new version of FanCruft, but I’d describe its current status as “doesn’t work.” I’d mostly forgotten about my project to explore the Ubuntu software archives. My entry to the LW PD tournament was a spectacular failure, probably due to a small (1 line!) design decision.

On happier notes, I received my MA, completed the online ML-class (which I understand from other comments online was somewhat less in-depth than it really should have been, but was nonetheless enlightening and fascinating), and have been studying Clojure (I now know that it’s possible to create my imagined iforelse statement in Lisp, although using it would not fit the usual functional paradigm). Over the past few weeks, I’ve been working on a few small projects, including a website for organizing social projects — think stone-soup and barn-raising — and my scheduler, which can now prioritize goals and tasks given information on their difficulty and payoff. I’m probably going to shut down Alchemake in the next year, or at least seriously revamp it so it’s no longer just a Facebook game. The idea that hyperbolic discounting might be rational still has me in awe, although there are caveats to that idea.

Something else that’s been on mind — these annual reviews! There’s way too much time between them. I’ll probably experiment with quarterly reviews, so expect to see something roundabout the end of March/early April.

Overall, it’s been a meandering, blah 2011. Here’s to a better 2012.


LW Prisoner’s Dilemma Entry — Rack Block Shooter

December 31 02011 (Saturday)
<?php
function rack_block_shooter($opponents_last_move = NULL, $round = 0) {
//returns TRUE for cooperate
//FALSE for defect
//in most loops, $i is the currently considered frequency of cooperation
static $probs = array();
static $prev_strat;
static $maybe_playing_self;

if ($round == 0) {
//setup probability arrays
//first key is our previous move
//second keys are frequency of opponent's coop
$probs = array(); //reset probabilities for first round of a match
$maybe_playing_self = TRUE;
for ($i = 0.00; $i <= 1.00; $i += 0.01) {
$probs[TRUE][(string)$i] = 1 / 101;
$probs[FALSE][(string)$i] = 1 / 101;
}
$prev_strat = FALSE; //Start with Defection to make self-indent slightly easier, defection as sign of a good/nice strategy -- therefore prob. other LWers more likely to start with coop; Also immediately sorts out Tit-for-Tat
}
else {
//update probs
if ($maybe_playing_self) {
if ($prev_strat != $opponents_last_move) {
//are we playing against ourselves?
$maybe_playing_self = FALSE; //Not if both sides don't make the same move
}
}
$prob_see_coop = 0.00;
for ($i = 0.00; $i <= 1.00; $i += 0.01) {
//the probability we would see cooperation given our move
$prob_see_coop += ($probs[$prev_strat][(string)$i] * $i);
}
for ($i = 0.00; $i <= 1.00; $i += 0.01) {
if ($opponents_last_move) {
//opp coop
$probs[$prev_strat][(string)$i] = $i * $probs[$prev_strat][(string)$i]/$prob_see_coop;
}
else {
//opp defect
$probs[$prev_strat][(string)$i] = (1 - $i) * $probs[$prev_strat][(string)$i]/(1 - $prob_see_coop);
}
}

//Now, decide what to do
if ($round == 1) {
//second round, do the opposite of whatever we did the first round
$prev_strat = !$prev_strat;
}
else {
//middle of play, choose move randomly proportional to expected payout
//Begin by calc'ing the prob of coop again for both cooperation and defection
$prob_see_coop = array();
$prob_see_coop[TRUE] = 0.00; //the probability we'll see coop if we coop
$prob_see_coop[FALSE] = 0.00;  //the probability we'll see coop if we defect
for ($i = 0.00; $i <= 1.00; $i += 0.01) {
$prob_see_coop[TRUE] += ($probs[TRUE][(string)$i] * $i);
$prob_see_coop[FALSE] += ($probs[FALSE][(string)$i] * $i);
}
file_put_contents('updating.txt', implode("\t\t",array(implode("\t",$probs[TRUE]),implode("\t",$probs[FALSE])))."\n", FILE_APPEND);
if ($maybe_playing_self) {
$prev_strat = TRUE;
}
else {
if ($round == 99) {
//be slightly evil -- always defect on the last round if not playing against self
$prev_strat = FALSE;
}
else {
$expected_value = array();
$fudge_factor = 0; //roughly, how much do we dislike the other player
$expected_value[TRUE] = 4 * $prob_see_coop[TRUE]; //+ 0 * (1 - $prob_see_coop[TRUE]); 
$expected_value[FALSE] = 7 * $prob_see_coop[FALSE] + 1 * (1 - $prob_see_coop[FALSE]);
$total_exp = array_sum($expected_value);
$prop_coop = ($expected_value[TRUE] - $expected_value[FALSE])/$total_exp;
$choose_mixed = lcg_value(); //random in the range (0,1) -- differs from rand() as rand generates integers only

if ($expected_value[FALSE] > 1.5 * $expected_value[TRUE]) {
$prev_strat = FALSE;
}
elseif ($expected_value[TRUE] > 1.5 * $expected_value[FALSE]) {
$prev_strat = TRUE;
}
else {
if ($choose_mixed <= $prop_coop) {
$prev_strat = TRUE;
}
else {
$prev_strat = FALSE;
}
}
}
}
}
}
return $prev_strat;
}

Solar Airships

October 23 02011 (Sunday)

Seen Today:  “Solar Ship sails the skies, schlepps supplies.” Looks neat.


Signs of the Times

October 13 02011 (Thursday)

MeetUp has “Occupy, Tea Party, Small Biz, Moms, Fitness, [and] Tech” as “Featured Meetups.” With the possible exception of “Moms,” all products of our very interesting times, and maybe the best summary of current events possible in so short a space:

Screenshot of Meetup.com


Tea?

August 27 02011 (Saturday)

Here are some more unpopular and raved about innovations: drying fruit in the sun, dancing, the iphone, the gin and tonic, the internet, Christianity, watercolour painting, eating a larger meal at lunch time than in the evening, sexual promiscuity, tea

– Katja Grace, “Why we love unimportant thingsMeteuphoric.


A Thought About Identity

August 18 02011 (Thursday)

If you’ve never asked yourself who you are, you probably don’t know.