Category 'uncategorized'

Cross-platform command line arguments syntax

26 Feb 2016

I’m rewriting Moderator (yet another command-line argument parser), and with Swift now being available for both OS X and Linux (Ubuntu) it should support a syntax which enables applications to fit in on both platforms.

POSIX* is I think the closest thing to a standard for this, so it will be the basis, with some modifications (The Python documentation also has some good insights).

* OS X is POSIX compliant and so is Linux (mostly).

New theme and new host

27 Jun 2015

Did not post anything last week, as I have been busy moving the site over to BlueHost and setting up a new theme. All because I wanted Swift code highlighting, and WordPress.com doesn’t support that. This of course took a lot longer than anticipated, but it’s finally done and if I do say so myself the new theme is simpler and easier to read. So all in all it was worth it.

Making a Numeric Type in Swift

30 May 2015

Fabián Cañas demonstrates something similar to mixins in Swift (for operators):

By defining types (and protocols) around capabilities, and writing functions that target those capabilities, we end up with cleaner and remarkably reusable code when compared to implementing functionality targeting a specific type. The bulk of our final implementation has nothing to do with distances, time intervals, apples, oranges, or anything else. It reads more like a set of statements of fact that any future programmer could adopt if they so chose.

Swift: Associated Types

24 May 2015

Russ Bishop has a clarifying post about Swift protocols and generics:

Type parameters force everyone to know the types involved and specify them repeatedly (when you compose with them it can also lead to an explosion in the number of type parameters). They're part of the public interface. The code that uses the concrete thing (class/struct/enum) makes the decision about what types to select. By contrast an associated type is part of the implementation detail. It's hidden, just like a class can hide its internal ivars. The abstract type member is for the concrete thing (class/struct/enum) to provide later. You select the actual type when you adopt the protocol, not when you instantiate the class/struct. It leaves control over which types to select in a different set of hands.

But I do think he is too harsh on the functional programming hipster kids.

Adding an XCode project to Git

18 Jan 2015

When creating a new project in Xcode it is best to leave the “Create Git repository” box unchecked because it will immediately add all files to Git, including those that are specific to you and are of no interest to anyone else. Instead you can run this script from the project folder, which will add only the files that should be under version control:

TextSmith - an application for writing

24 Mar 2013

In The ultimate word processor, I described my ideal application for writing. Here is a much more thorough description of its key features and basic workflow.

It’s a bit hard to classify, but here goes:

  • Integrated Writing Environment: Like the Integrated Development Environments (IDE) programmers use, it tries to provide writers with all the tools they need, and lets them adapt it to their workflow.
  • Semantic Text Editor: It lets you describe what the text means as opposed to how it looks.
  • Word Processor: This term is normally used for Word, OpenOffice, Pages etc, but these are more page layout applications than literally “word processors”. TextSmith, with its various plug-ins for importing, transforming and exporting text, can literally perform “word processing”.

But the best description is probably just “Writing Application” (as in; an application for writing).

How to import voice memos into Things

02 Dec 2010

I usually write new ideas into the Things app on my iPhone straight away, but sometimes it’s better to just dictate into the Voice Memo app instead of typing. Here’s how you automatically add those voice memos to the Things inbox:

My Dream Gadget: A Really Big iPod Touch

19 Apr 2009

My idea of the perfect device would essentially be an iPod touch with a screen the size of an A4 sheet of paper. It would be brilliant for surfing the web and reading e-books and PDF’s. Anyone who’s tried to do that on an iPhone or an iPod touch would appreciate not having to scroll for every paragraph. And in addition to running iPhone apps it should be able to remote control a Mac. Just imagine sitting in the living room and using Front Row on this thing. Not to mention playing an adventure game. Only problem is with a touch-screen that big it would probably end up costing as much as a desktop computer. So we probably won’t see it for a couple of years.

But eventually it will be made. It’s just too obvious and idea for it not to.

Welcome

20 Mar 2009

Hi, and welcome to my blog. It will almost exclusively be about programming (iPhone-programming to be specific), so if that’s not your particular cup of tea then you’re probably better off with this one. I’m aiming for two or three posts a month, so hopefully I won’t be contributing too much to the unread count of your RSS reader.

PS: I know I’m using the default theme for WordPress, but I really like it and I’ve only seen one other blog using it. If I should happen to come across a better one I might change, but for now I’m happy with this one.