My Office Might Be the Best Amsterdam Incubator

March 12th, 2012

Startup incubators are all the rage right now (in fact, they might have jumped the shark ;-), and Rockstart is the talk of the town here in Amsterdam. But I was just thinking the other day, my office actually has a pretty nice record of interesting startups.

Some organizations that have spent time here:

  • Bits of Freedom: Ok, not a startup but still an awesome organization.
  • Bottlenose: “The smartest social media dashboard.”
  • NARB: Gone but cool while it lasted. Essentially a social network for galleries and art lovers.
  • Newcope: Also gone but one with real potential: an auction platform for in-game virtual goods.
  • Spaaza: Getting retailers’ inventory information online and on Facebook. Fred de la Bretoniere just launched their Facebook inventory powered by Spaaza last week, and I expect lots more cool announcements soon.
  • Tupil: iOS and Mac apps, including the Beamer app to play any video on your Apple TV.

Not bad, eh?

Python-style in in Scala

March 10th, 2012

Because hey, why not?

In Python:

>>> 1 in [1, 2, 3]
True

In Scala:

class In(a: Any) {
  def in[T](s: Seq[T]) = s.contains(a)
}
implicit def any2In(a : Any) = new In(a)
 
scala> "a" in List(1, 2, "a")
res0: Boolean = true
 
scala> "a" in List(1, 2, "b")
res1: Boolean = false

Unreader: Or, How to Fight Back Against Stupid Facebook Reader Apps

March 6th, 2012

I made a bookmarklet, and it will open the articles your friends share on Facebook without all the stupid prompts to install the site’s ‘social reading app’. It’s called Unreader. Enjoy.

Two Desks Available in My Office

March 1st, 2012

The title says it all. The rent is approximately €90 ex BTW per desk and you’d be sharing the 43 m2 space with me and Tupil, aka Ben and Eelco.

The desks are available because Spaaza is moving down the hall to the office I mentioned earlier, which means that the tech scene on our floor is only getting bigger. You’d be joining a great, growing community of hackers – heck, we even do Nerd Yoga!

Office Available in the Volkskrantgebouw

February 23rd, 2012

There’s an office available down the hall from mine, right next to @ouroffice. The space is 35m² and a steal at €375/month (including super fast internet, and all taxes). It’d be great to have another startup or otherwise group of techies in the house!

Presentation this Thursday at the Microsoft TechDays GeekNight

February 13th, 2012

I’ll be giving my Mobile APIs: Client and server should be friends presentation (sans Daniel this time) at GeekNight. It’s part of the Microsoft’s annual TechDays conference, and my presentation will be at 19:15 on Thursday in the Hague. The presentation should be a good intermediate-level overview of API development in service of awesome mobile apps, and it comes complete with an all new colorful Metro presentation style! =)

A Mobile Tablet Interface

February 3rd, 2012

Recently I developed with Alexander Zeh an interface for an Android tablet app for the agents in an African mobile payment network. It was a pitch for the company, and while we weren’t selected we’re quite happy with our work and decided to share it with you. You can find our designs and analysis at http://bubblefoundry.com/tabletinterface/.

How to get enumerations when using Scala’s parser combinators

January 23rd, 2012

This took me a while to figure out, so I figure it’s worth sharing here. In the end it’s quite simple thanks to Parser’s ^? method, but it took me a while to figure out:

gitback

January 6th, 2012

Feargal had a good suggestion in response to my complaint that private repos on GitHub were too expensive, which was download old repos to Dropbox and then delete them from GitHub to make room for active ones. To do this I wrote gitback today. Enjoy.

Tips for merging a Git repository into an SVN one

December 22nd, 2011

Recently I finished a project that I’ve been working on and wanted to delivery it to the client. Unfortunately, I’ve been using Git, while they wanted me to commit the code into their monolithic Subversion repository. Of course the easiest thing would be to simply commit an export of the project into a new directory, but that would involve losing a lot of important information contained in the commits and their commit messages.

The solution, then, is some git-svn magic. I found most of the tips in one helpful article, but I still had enough gotchas that I figure it’s worth outlining my process here.

I’m assuming standard branch, tag, trunk organization for both the git and svn repos. We’re going to be working in a directory that initially only contains the git-tracked code in a subdirectory called repo.

      1. Move all files in your git repo into the desired subdirectory:
        cd repo
        git mv [all files] myproject

        What I’m doing here is preparing my code for life in the monolithic svn repo, where we’ll want it under a subdirectory, here named myproject.

      2. Clone the trunk of the svn repo:
        cd ..
        git svn clone svn://server/repo/trunk repo-remote

        Here I’m cloning the trunk of the svn repo into a git-svn repo called repo-remote.

      3. Fetch the git repo into the git-svn one:
        cd repo-remote
        git fetch ../repo
      4. Then go to the new tree and make it into a branch:
        git checkout FETCH_HEAD
        git branch tomergeTEMP
        git checkout master
      5. Now we’re going get the SHA1 hashes needed to graft the two trees:
        git rev-list --reverse FETCH_HEAD  | head -n 1
        git rev-list --reverse HEAD  | head -n 1

        Let’s call the first hash repo-SHA1 and the second repo-remote-SHA1.

      6. Put those into a graft file for git-svn to use:
        echo repo-SHA1 repo-remote-SHA1 > .git/info/grafts
      7. Rebase the git-svn repo:
        git rebase tomergeTEMP
      8. Now do a dcommit dry run:
        git svn dcommit --dry-run

        You’ll get a bunch of lines that look like:

        Committing to svn://server/repo/trunk ...
        diff-tree hashA~1 hashA
        diff-tree hashB~1 hashB

        All the articles just give the line above and say to check the patches, but how do you actually check them? It turns out it’s quite simple:

        git diff-tree hashA~1 hashA -u

        This will give you the patch that will be applied. (I’m not sure whether the -u is useful.)

      9. Finally, commit:
        git svn dcommit

        It should go through and commit to the svn repo each git commit.

When it’s finished the code from your git repo should be in svn://server/repo/trunk/myproject.

However, I had a few hiccups. First, I got a merge conflict on one of my commits.1 I resolved it like so:

git mergetool
git add [corrected files]
git rebase --continue
git svn dcommit

You’ll notice that not only did I have to continue the rebase operation that git svn dcommit had called internally, but I actually had to call git svn dcommit again.

Second, I had some unnecessary folders because I had moved my files in and out of some folders (hopefully you won’t have this problem because you followed my first two steps). Rather than try to remove the unncessary folders using my git-svn repo, I checked out a new working copying via svn:

cd ../
svn co svn://server/repo/trunk repo-svn
cd repo-svn
svn rm [extraneous dirs]
svn commit -m "Remove directories incorrectly left by git-svn"

And there you go. Hope that helps!

  1. Which is bizarre considering that I successfully committed it earlier. []