Solved Problems

| Tags: dev, ios, swift

I’m that kind of guy who loses interest in problems once they are solved. That’s why I seldom write about software development on this site although developing software is what I’m doing most of my time.

Problems interrupt the flow. They require me to experiment again and again with seemingly not getting anywhere for some time. Solving problems also involve finding some good search terms that will make DuckDuckGo bring up some StackOverflow page or some blog post that at least contains some hints at where the solution might be lurking. Having solved a problem is fun. Achievement unlocked. Problem solved.

After a problem is solved the flow becomes tangible again. So I usually don’t write about solved problems. I plunge into the flow towards new challenges.

I applied for a job as an iOS developer some days ago and they asked me to do a homework to verify the truthfulness of what I told them about my skills. They asked me to develop an app showing fake statistics data for an unnamed website. The app was also required to contain a today widget.

As I developed the app and the widget and wrote tests for both, I realized that it presents the solutions to some problems in a pretty uncluttered way that might be useful to other people.

So I put it on GitHub. It shows my current opinion on the development of testable iOS apps in the Swift programming language.

Although it makes some use of ReactiveCocoa 3, I’ve still got the inkling that there is much more to functional reactive programming than how I use ReactiveCocoa now. So don’t take it as a primer on that subject. It’s still a good starting point, though.

I’ve read many comments from iOS developers complaining about AutoLayout. Perhaps because I’m used to this kind of layout management from the Java projects I’ve worked on, AutoLayout has never been a big issue to me. I actually like it. I’ve never been a fan of GUI builders and avoid Interface Builder whenever possible. I create my UIs programmatically. Sure, it’s quite verbose when you use the low level API, but I always have a simple wrapper around it that I started developing while working on Space Primacy. It’s so simple that I didn’t bother releasing it as a framework. That’s one of those solved problems I mentioned above.


| Tags: app, health, weight, dev, ios

When I created the first project that I would show to the world, I had quite a problem to find a good name for. I read all the tips about naming software and somehow came up with the name “Squareness”. It was a look and feel for the Java Swing library that used rectangles quite a lot because rounded corners looked bad back then a decade ago. But I couldn’t come up with a nice sounding name containing “rectangle”, “rectangular” or something like that and “squareness” also had other meanings that seemed fun to subtly add to this project.

I realized very soon that the name was a mistake. As many — or maybe all — who release something to the public, I wanted to know if others talked about it and what exactly they said about it. Use your favorite search engine to search for “squareness” and you’ll get many search results. Back then when Squareness was in active development it wasn’t any easier than today to really find the results that dealt with my project.

So for the next big project I came up with a new strategy. I wrote down a sentence describing it, “OSGI Module Layer and Eclipse RCP support”, and played with the beginnings of the words until I came up with “Osmorc”. That name had a nice sound to it. It was also short and searching for it produced only very few results.

I used similar strategies for Bookitics which came from “book critics” and Appiast which came from “app enthusiast”.

So after this lengthy prelude let me introduce my next app: “Weighort”. This is from “weight report” and the app is a weight tracker. I like that it rhymes with “weird” and “way”, because it probably looks weird to release another weight tracker and because it gets along with the bold tag line “your way to your target way” which I’ve chosen for it.

What sets it apart from other weight trackers is that it integrates perfectly with the Health app and just looks better than any other I looked at. It’s a joy to enter your daily weight into it and instead of those graphs present in every weight tracker nowadays, it just shows two informative bar charts that motivate you to work on reaching your target weight.

For more information about it and a convenient link to the App Store look at its website.

Octopress 3

| Tags: blogging

It’s now a bit more than two years since I started using Octopress to generate this website. Although Octopress was always reliable and a joy to use, one aspect bothered me from the beginning.

To use Octopress you had to clone its git repository and add your stuff into it. So there was no separation between the source of the website and the tool to generate it.

This changes with the new Octopress 3 which is now a set of Ruby Gems. Things which were earlier part of Octopress are now available as plugins and it’s quite easy to activate the usage of a plugin. Octopress 3 isn’t finished yet. For some of it’s parts release candidates are available while others are already marked “1.0” or higher. The biggest missing thing is probably an updated documentation and some kind of guide how to move from Octopress 2 to Octopress 3. already gives an overview of what’s coming.

My website is a rather simple one. So I took the plunge and ported it to Octopress 3. I got Octopress to generate a new site with octopress new and found that it generated a directory structure that I was partly familiar with. That’s really no wonder as both are Jekyll sites and although Octopress 3 supports the current version of Jekyll where my Octopress 2 site still used a much older one, the main building blocks of a Jekyll site stay the same. There’s still a folder for posts and others for templates and includes. I replaced the generated stuff with the counterparts of my Octopress 2 site.

After temporarily deleting some parts that depended on plugins I hadn’t found Octopress 3 replacements for yet, I got a first raw site that looked OK.

Now I had to weed through _config.yml. Octopress 2 had generated a bunch of entries here I didn’t see in the generated output from Octopress 3. Some of them I could ignore, because I hadn’t filled them in for the old version. Those were settings for various social networks like Facebook, Twitter and so on. Others I had to search for on to verify that they are Jekyll settings and not some Octopress specialty that might not exist in Octopress 3.

One of those Octopress specific settings is date_format which allows to define a format for dates and then provides convenient functions to get dates in that format. This is one of the Octopress features which are now extracted into a separate plugin octopress-date-format.

Jekyll now handles SASS directly and with octopress-asset-pipeline the resulting CSS can be merged with other CSS files like normalize.css and minified.

I was lucky that one of the plugins my site depends on, jekyll-tagging, still works with the newest Jekyll and Octopress 3. So that was quite easy.

The next one was harder. Since the early days of the blog — when I used MovableType —, the site provides monthly archives and an overview of the times when I wrote something. When I moved to Octopress 2 I searched and finally found one Jekyll plugin that created the monthly archive pages. After playing around with it some time I succeeded to add the overview to it. Unfortunately that plugin didn’t work with Octopress 3 and the newest Jekyll. Luckily while browsing the list of Jekyll plugins I found one that did most of what I needed: jekyll-monthly-archive-plugin. After reactivating my dormant Ruby knowledge and trying around, I succeeded to make it do what I wanted. There surely is a more elegant way to do it, but here it is for anyone interested. You just need to put {{"{{ site | archive_block "}}}} somewhere you want that archive overview block to appear.

I’ve been using Octopress 3 for nearly 8 months now. Sometimes when I update the Octopress gems, something breaks, but the developers of it are usually fast at finding and fixing the problem. If it takes them longer I always can go back to the last collection of Ruby Gems that worked as I use git to keep the history of all changes I make to it.

South of the Border, West of the Sun

| Tags: book, fiction

After more than half a year, it’s again time for a book by Haruki Murakami today. One surprising aspect of “South of the Border, West of the Sun” is that it doesn’t contain any fantastic elements. There are no weird parallel worlds, no talking cats and also no strange sheep men.

This book is rooted in the world of here in Japan of the eighties. It’s a story about a man and his different relationships with women. It starts in his childhood and ends in his adulthood.

After reading it, I felt oddly reminded of “Old Boy”. The book is different. The pain inflicted and the vengeance — if it really is vengeance at all — is different, but somehow the feeling of sorrow is very similar.

It’s a book that lives in its dialogues. In that way it reminds me of another favorite Murakami book “After Dark”. Like “After Dark” it’s also a rather short book. So it’s a nice fast read that doesn’t branch out into any side narratives.

Space Primacy

| Tags: app, game, dev, ios

Coincidentally at the time I was thinking about what new endeavors to undertake, Apple announced its new programming language Swift. Swift looked fresh and exciting and it didn’t have those square brackets that somehow always got in the way. So I dived into the new material and started learning Swift.

Then I got that crazy idea about developing a game. Probably since getting my first computer and playing “Digger” and “Duke Nukem” on a CGA monitor attached to an MS-DOS PC, I’ve been thinking that developing a game would be quite cool. But somehow I never got beyond programming some animations.

Looking at the games I played on my iPhone and iPad, I realized that there is just one that I keep returning to. That game is Letterpress. The reason for my sticking to this game is that it is a turn-based strategy game I can play against random opponents via Game Center. There’s no need for finger acrobatics and no timer ticking away on you. And although the game has rather simple rules it’s always new as you play on a different board against different people.

So I wanted to create something of that kind. The barriers looked quite surmountable. Game Center provides the whole networking layer and SpriteKit is a nice and simple game engine.

Looking around the internet, I came across a description of a board game that looked perfectly suitable for an adaptation as a game for the iPhone and iPad. It has interesting rules and the board is dynamic in a way that it can be laid out perfectly on any of the different iPhone and iPad screen sizes.

8 months later we’re here and Space Primacy is available on the App Store. As the packaging tells , it’s a turn-based strategy game for two players. Your goal as a player is to assert your space primacy — that’s where the name of the game comes from. Each match is played in a different galaxy and to win it you have to either destroy the headquarters of you opponent or expel them from it. There’s no diplomacy. It’s all about winning a war. So it’s down to tactics and a good portion of economics.

Apart from the mentioned online matches via Game Center, there are also two modes for local matches. There is one local mode for when you are on a train with your opponent or otherwise sit side by side on a sofa or something like that, passing the iPhone between the two of you for each turn. In that case Space Primacy rotates the board so you don’t need to rotate the device between turns.

The other mode is the classic board game mode where you and your opponent sit across from each other with the iPad or iPhone on a table between yourselves. Neither the device nor the board needs rotating and both players have optimal access to the controls needed to issue commands to their space ships.

As I dislike ads and freemium apps that nag you to buy another chest of gold, Space Primacy has neither. It has a price and if you pay it, you get all of it.

And here’s the magical last sentence: I hope you’ll enjoy playing it as much as I enjoyed developing it.

The Great Gatsby

| Tags: book, fiction, classic

Here’s another literary classic. In some article on Quora someone claimed “The Great Gatsby” to be a great and beautiful book that anyone should read.

I’ve watched at least two movie adaptations of this book. The latest one with Leonardo DiCaprio was quite good. The book is a short one and as it is a classic from 1925 I grabbed a free Kindle edition of it.

It is a heartbreaking story of a poor man who falls in love with a woman from a rich family. He disappears for some years, earns some medals in the first World War and tries very hard to earn enough money to be worthy enough to marry his love. Unfortunately she gets bored and marries a rich man before Gatsby, the poor boy turned rich gentleman, can return and ask her to marry him. He tries to make her leave her husband, who’s having an affair with another woman, but fails. The moral of the story is that the rich destroy the lives of the poor without noticing or even caring.

I was a bit disappointed by the book. I had expected a deeper experience. The book didn’t add anything that might have been missing from the movies. There were no deeper explorations of the inner workings of the protagonists. The whole book felt somehow superficial. But somehow this superficiality is true to the story about people living their superficial lives and looking at the rest of the world from a superior position that prevents them from seeing any details.

So while I didn’t like that book much because I couldn’t submerge myself in its story, I think, the author — F. Scott Fitzgerald — succeeded to convey how a snobby upper class looked at the world around them in the early 20th century. From that point of view, the book is interesting and it stirs some emotions of sorrow for the poor ones and contempt for the careless ones.


| Tags: book, fiction, classic

“Flatland – A Romance of Many Dimensions” by Edwin A. Abbott is one of the strangest books I’ve read to date. It’s also an old book from 1884, but I only recently learnt about it in an article about the movie “Interstellar”.

When it first was published the author used the pseudonym “A Square”. It’s a rather short book of — depending on publication — a bit more than 100 pages. In the first third of the book the square describes how life looks like in Flatland, which is a world of two dimensions.

The inhabitants of Flatland live in strict hierarchies. The circles are at the top and triangles with non-equal sides are at the bottom. Even below them in the hierarchy are the lines, which are the women of Flatland, who are said to be brainless because they have no interior. Many of those hierarchical descriptions are strange to us now and the low regard of women seems outrageous, but apparently it reflects the situation as it was at the time the book was written.

More interesting than the hierarchies is the way the inhabitants of Flatland live. As they live in a world of two dimensions, a square that meets a pentagon doesn’t see that it meets a pentagon. It only sees a line. Because conveniently there is always some kind of fog in Flatland, the line has different levels of brightness and those higher in the hierarchies can infer from those patterns what they are seeing. Those of lower positions must feel each other to recognize the angles of the other inhabitant.

So that’s really strange, but the square also visits Lineland, which is a world of one dimension, and Pointland, which is one of no dimensions.

But actually the core of the book is when a sphere from Spaceland visits the square and tries to tell it about it’s own world of three dimensions. That’s really quite a bit of an undertaking. It’s probably as hard as if someone from a world of four dimensions would try to explain that to us.

So the connection to “Interstellar” is this difficulty of grasping a higher dimensionality than the one we are living in. The iPad-app “The Fourth Dimension” does an amazingly good job of explaining the geometrical aspects of the fourth dimension in terms of the three we are acquainted with, by the way.

But the book is more than a treatise on different levels of dimensionality. It also shows how hard it is to accept new ideas and facts and how those who try to convey them are often faced with hardships.

There is no real story or adventure in this book. There’s no red thread that will captivate you from the start till the end, but just coming up with those ideas about Flatland, Spaceland and the others is mind blowing.

So while not for great storytelling, this books gets full marks for inventiveness.

My Verdict on "The Circle"

| Tags: book, fiction

Apparently my last post about “The Circle” lacks an actual review and a clear recommendation to read or avoid the book. Thanks to Urs Reupke for spotting this omission. So, this post is a follow-up meant to add the missing parts.

The book is a documentary of a possible future. It’s not exciting in itself. You won’t read it for its stylistic finesse, because there is none or at least none of which I am aware. But that’s probably what makes it so readable. You feel right at home. There are product presentations that could be part of an Apple keynote. There are discussions with people who totally avoid using social networks and between those who use them modestly and those who use them to protocol each of their movements.

It’s from this familiarity that Dave Eggers shows us what could be the next steps. And as you see those next steps from a distance you get a chance to think about them in way you most likely won’t while being part of the development.

So I highly recommend this book because of the thinking it triggers.

The Circle

| Tags: book, fiction

Privacy, security and mass surveillance have been hot topics since Edward Snowden’s revelations. So it’s no surprise that some authors take up those topics and write books based on them. Dave Eggers’ “The Circle” is one of those.

For me “The Circle” is a modern variant of “1984”. Dave Eggers takes all the nice and cool technology we have today and asks “What if we push it further? What if we do what can be done?”. Because he takes what we know and use nowadays it’s far more shocking and depressing than “1984”. “1984” feels archaic and funny at times when read today. “The Circle” seems to be pretty possible.

The Circle is a big company. Just picture a company that produces the devices most people buy, provides the search engine most people use and owns the social networks most people spend their time on. And it’s a company that still grows as it regularly gulps new startups they call “plankton”.

The Circle gradually introduces new technology and new features that cut away at the privacy of its users. It’s all for the bigger good. As each of the new technologies provides new levels of convenience to them or even goes so far as to prevent crime, people are amazed and demand it before it’s even available.

Consequently people find new ways to employ those new technologies for even more convenience and security, happily accepting that in the end there is no privacy, no place on earth were you cannot be seen on some camera.

“The Circle” ends with a depressing vision of total surveillance and poses the question “At which point does sacrificing privacy for convenience and security turn out to be insecure and inconvenient and will we be able to turn back when we reach it?”

A Wild Sheep Chase

| Tags: book, fiction

Last week I’ve been on a short vacation at the Baltic Sea with my parents, my sister and her family. As I’m quite addicted to reading fiction books whenever there’s an opportunity, it was no question whether I would take a book with me. The question was more which and in which format. Normally I would take my Kindle Paperwhite which I use for most of my fiction reading. But with children and a dog around, I decided to take a paperback with me. You can toss it into a corner and even sit on it if you feel like it. And if it gets torn it’s not as expensive to replace as a Kindle. Looking at the paperbacks in my bookshelves that I haven’t read yet, I finally decided to read “A Wild Sheep Chase” by Haruki Murakami.

I’ve read some books by Murakami during the last few years and whenever asked I’ll say that for me Murakami’s books are like the movies of David Lynch. They are weird and often while reading you don’t understand what’s going on. Most of the time they are pretty slow books. So there isn’t much suspense driving you to read on and find out what’s going to happen next. The thing that keeps me reading those books from cover to cover is a mild sense of curiosity of what strange idea he’ll come up with next. And then the writing is very well or more correctly what the german translations I’m reading — as I have no clue of Japanese — succeed to preserve is well written. I like those strange dialogs and those strange protagonists having them.

Like with any other book by Murakami, it’s rather pointless to give a summary of the book. At the center is a guy who’s made to look for a sheep by some mafia boss. But that’s not why you would want to read it or “After Dark”, “Kafka On The Shore” or “Hard-Boiled Wonderland And The End Of The World”. It’s just because they are very satisfying reads.