Last day of Unite Nordic

Thu May 23, 2013 by brett

Yesterday was the last day of Unite Nordic. The highlights of the conference for me were:

  1. Helen winning a copy of Unity Pro. Funnily enough; she wanted to walk out just before they drew the winners of the competition, and I made her stay.

  2. Hearing the Rovio guys talk about Bad Piggies, and then chatting with them afterwards. They were really nice guys.

  3. The MechAnim talk was inspiring! The speaker created a game on the fly.

  4. The talk about creating apps for China was really interesting. I learnt a lot from this, and it really hammered home the fact that mobile is king.

  5. I enjoyed the talk about selling assets in the Asset Store.

  6. Meeting lots of new people!

All in all the conference was inspiring and gave us a lot of ideas.

Walking Copenhagen

Mon May 20, 2013 by brett

Today we spent the day walking Copenhagen. Lunch was pickled herring at a spot down by the canal. I resisted having (what looked like the traditional) beer. Helen and I didn’t realise that it was a public holiday here, and were marvelling at the closed shops and the amount of people drinking beer at lunchtime. There was some kind of parade or march and the street was hazy with smoke.

En route to Unite Nordic

Sun May 19, 2013 by brett

Helen and I are on our way to Unite Nordic, the Unity3D conference being held in Sweden. Next stop is Copenhagen!

Starting apache on OS/X Mountain Lion

Sat May 18, 2013 by brett

Apache is still bundled with Mountain Lion, but you can no longer start it using the “Sharing” icon under the “System Preferences” app.

To start it from the command line, just type:

sudo apachectl start

If you want to recreate the old behaviour where the “~/Sites” directory for a user can be accessed via http://127.0.0.1/~username/

create a file called “username.conf” under the directory /etc/apache2/users/ (replacing “username.conf” with your user’s short name) before starting apache.

For example:

sudo vi /etc/apache2/users/brett.conf

Then add the following to the file:

<Directory "/Users/brett/Sites/">
    Options Indexes Multiviews
    AllowOverride AuthConfig Limit
    Order allow,deny
    Allow from all
</Directory>

Note that you can point this to any directory under your home directory. If you use ~/Sites for your http/php files, make sure you create the directory first:

mkdir ~/Sites

Now start apache:

sudo apachectl start

If you want to start apache, use:

sudo apachectl stop

If you want to start apache on every boot, use:

sudo launchctl load -w /System/Library/LaunchDaemons/org.apache.httpd.plist

Productive Workflow

Fri May 17, 2013 by brett

I’ve been using time-boxing for quite a while, off and on. I have a task list every day and start timing chunks of time in which to work on the tasks. I’m not like Helen, who finds it easy to work at home. I find it far easier to work at a client’s office. This has changed recently though, thanks to my new work-flow.

I now use the Pomodoro app to start my time-boxing sessions. I have it configured to link to Things (I am running the Things app on my Mac Air, as well as my iPads and iPhone). I also have it publish each time-box to my iCal calendar, so I can generate graphs of how much work I’ve done each day.

I’ve found that since I’ve been working like this, it’s much easier to get started on my tasks every day. I find I am procrastinating much less. I also know that I can just throw a task into my Things app, and it will be done.

Bret Dunlap, Runner

Thu May 16, 2013 by brett

There is a wonderful story over at Runner’s World about Bret Dunlap, a guy who was badly injured when he was a kid. His brain and body are damaged. It’s about how he moves on and adapts. How his mother helps him recover and build a life. How he discovers running and it helps change his life. The story is poignant and well written. It’s definitely worth reading.

What Google Glass might soon be like

Wed May 15, 2013 by brett

There is an interesting clip over on YouTube, that shows what having Google Glass (or something similar) might someday be like.

I loved some of the ideas presented here, although I thought the scene with the 911 operator could have been done better. What should have happened is the emergency operator should have connected him directly with a doctor. The doctor would then guide him through diagnosis and emergency response procedures, monitor the situation using the head-mounted camera.

Custom UITableViewCell Delete Woes

Tue May 14, 2013 by brett

I’ve just spent some time solving an issue in my iOS app. I have a custom UITableViewCell with some UILabels. When I delete a row on the UITable, the standard confirm delete animation happens. With the standard UITableViewCells, this triggers an animation where the cell labels move to the right, to make room for the delete icon on the left. With my custom UITableView, the UILabels weren’t moving to the right and were being squashed by the delete control.

It turns out that this problem is caused by the NSLayoutConstraint constructed in the storyboard. XCode creates a constraint bound to the cell itself, rather than the contentView. This was solved thanks to this StackOverflow post, that details the solution.

You need to create an outlet for the NSLayoutConstraints you want to delete and bind them in the storyboard. Then in awakeFromNib, you delete those constraints and add new ones. I’ve added my code for doing it with 2 UILabels below.

- (void)awakeFromNib {

    // Remove the IB added horizontal constraint, as that's effective
    // against the cell not the contentView
    [self removeConstraint:self.cellLabelHSpaceConstraint1];
    [self removeConstraint:self.cellLabelHSpaceConstraint2];
    self.cellLabelHSpaceConstraint1 = nil;
    self.cellLabelHSpaceConstraint2 = nil;

    // Create a dictionary to represent the view being positioned
    NSDictionary *labelViewDictionary1 = @{ @"_lblName" : self.lblName     };
    // Create the new constraint

    NSArray *constraints1 =     [NSLayoutConstraint constraintsWithVisualFormat:@"|-10-[_lblName]"     options:0 metrics:nil views:labelViewDictionary1];
        // Add the constraint against the contentView
    [self.contentView addConstraints:constraints1];

    // Create a dictionary to represent the view being positioned
    NSDictionary *labelViewDictionary2 = @{ @"_lblDesc" : self.lblDesc     };
    // Create the new constraint
    NSArray *constraints2 =     [NSLayoutConstraint constraintsWithVisualFormat:@"|-10-[_lblDesc]"     options:0 metrics:nil views:labelViewDictionary2];
    // Add the constraint against the contentView
    [self.contentView addConstraints:constraints2];
}

Getting a custom Info directory working with Emacs

Mon May 13, 2013 by brett

I’ve just had a frustrating 15 minutes trying to get a custom “Info” directory working with Emacs on my Mac. I like to have my own texinfo files in a ~/my/doc/info directory. Unfortunately, I was having a hard job getting Emacs to incorporate the directory whenever I hit Ctl-h i.

It turns out - as I found out when I invoked (getenv INFOPATH) - that emacs on the Mac sets the INFOPATH environment variable. By adding the following code to my .emacs file, I’ve added my own info directory and corresponding files to the top of my help info page.

(setenv "INFOPATH" (concat (expand-file-name "~/my/doc/info:") (getenv "INFOPATH")))

Don’t forget to add a dir file in your custom info directory. Additional information can be found on the Emacs Wiki.

Zero-Six Weeks

Sat May 11, 2013 by brett

A couple of years ago, when I was thinking a bit about frugality (as in; “Hey, that’s a characteristic I should have more of), I came up with the idea of a “Zero-Six Week”. This is a week where I am only allowed to spend money on one of the days (typically a Sunday). The aim is to buy enough necessities on the Sunday to see me through the week, and not spend any money at all the rest of the week. That means walking everywhere, making all the meals for the week, etc.

To date, I think I have maybe done it twice, although I am thinking of doing it next week.