Automatic builds in Xcode

Earlier this week, I finally got the secret of automated iOS builds cracked!

I had struggled throughout the summer with setting up my new Mac Mini server, with the intent of using it as a build server. I had already installed Jenkins, and it was pulling some projects in from github and running tests.

But I really wanted it for the Returntool project, as the manual ad-hoc iOS testing procedure was getting tedious.

Read more

Profiling JavaScript

Recently (as in yesterday) at work, I got to take a closer look at JavaScript profiling in WebKit, primarily by using console.profile(name) and console.profileEnd(name).

I won't go into all the specifics, as it is pretty well-documented already.

Instead, I'll go through a small use-case where I just solved an issue using this tool!

Read more

On asynchroneity and JavaScript

Javascript is a language heavy on callbacks. And as such, you quickly end up with deeply nested anonymous functions.

Take the following example, which reads a file, parses the content, makes a transformation, and writes it back out:

var fs = require('fs'),
    input = 'input.json',
    output = 'output.json';

fs.readFile(input, function(err, data) {
    var content = data.toString(),
        json = JSON.parse(content),
        result = json.reduce(function(a, b) { return a + b; });
    fs.writeFile(output, result, function(err) {
        console.log('done');
    });
});

Now, even as simple an example as this quickly becomes unreadable. But there is a solution. A simple pattern flattens the code, and makes it much more readable:

var fs = require('fs'),
    input = 'input.json',
    output = 'output.json';

fs.readFile(input, fileRead);
function fileRead(err, data) {
    var content = data.toString(),
        json = JSON.parse(content),
        result = json.reduce(sumNumbers);
    fs.writeFile(output, result, writingComplete);
};
function sumNumbers(a, b) {
    return a + b;
};
function writingComplete(err) {
    console.log('done'); 
};

The same functionality, only now much more readable.

Read more

New year, New plan

I know that I earlier mentioned some plans for what I would make next, but I changed my mind (this happens a lot ^^).

I actually got the QR-scanning widget functioning, but it is not polished enough that I want to release it. And I lost interest in it just around when iOS 5 got released. But I learned a lot, and definitely fell in love with core data ^^.

I have not started started on the social-integration stuff, and I don't think that I ever will. That would only be to figure out how to do it, so that I might do it in other projects.

A thing that all my projects have in common though, is that I want to bring unit testing and TDD fully into my workflow. I have been experimenting with both Behat and phpunit, which I will look closer at in a later post. And I am generally satisfied with jasmine, but I have seen some great recommendations for Mocha, such as full node.js integration. So I will take a closer look the next time I need to test JS-code.

Read more

Future Projects

I have a couple of plans for the projects that I might pick up in the future. 

Currently, there are two apps primarily for iPhone, and also somewhat for iPad and OS X, that I want to make. One of them, I started at the beginning of this weekend, and have made good progress on. 

Both are currently going purely by code names, and they will most likely be renamed before release. 

They will probably be priced, and I am currently thinking of 1$. Both projects are something I want to make for myself, so any income I make will be nice, and I would like to see if I can get at least some money from it. 

Read more

All Green

The JavaScript library I have been working on have finally gone green in the supported browsers. It took some time, especially as I have a habit of marking tests by just writing a title and then throwing an exception.

Read more

Compilation Complete

I have successfully completed the compilation of my blog, and transferred all my posts into markdown.

It went down really fast, actually. And it was quite fun. I now have a markdown-compiler in the project, as well as some PHP file management. And I made my own template engine!

Read more

The Future of the Blog

I have not looked at building the blog for a number of days, for a couple of reasons:

  1. I have been busy with other projects.
  2. The novelty of writing a blog have kind-of worn off.
  3. I am unsure of the direction, that I want to take the software.

The first is a question of prioritization, and it is a chronic problem of mine ^^. The second comes and goes. I started with having a clear and ineresting goal, I achieved that goal, and lost inerest. I might find the interest again (I usually do), and I most certainly will lose it again. That is just how I function.. The third is the most interesting, and I will delve deeper into this now.

Read more

Current State

The current state of the blog is kind-of frozen, as in I completely forgot about it for some while. I have not really worked on it, but I have not forgotten it completely, as this post indicates ^^.

I have not relay come much further with my minesweeper, as I got consumed by other projects. There are three in particular:

  • LCARS - I began an LCARS inspired interface made completely with web technologies (JS, CSS, HTML)
  • Find Me! - a locate-your-friends kind of app, for iPhone, android and other modern smart phones.
  • Savage Worlds Char Sheet - a character sheet for savage worlds, for the iPad primarily, but all modern browsers as a secondary target.

There are a number of other projects I also would like to explore, to a greater or lesser extend. One of them is this blog.

Read more

We have lift-off

The blog is finally in a finished-enough state that I can launch it without being too ashamed ^^. It's not entirely done, though, and it properly never will be. That's the beauty of self-instated projects. They are not finished until you no longer wish to work on them.

One thing i've noticed is that the current model is not compatible with Safari's reader-mode, nor is it presently compatible with RSS feeds. Feeds would be first priority, as that is the only way I personally read blogs. Reader compatibility is not that important, as my current design is extremely bare-bones; There are no noise to cut away.

Still, it is launching, and I will fix the most egrerious mistakes first, and then look to the rest as I find problems. and go on to the next thing :).

Read more

The Coming of the iPad

The blog is almost done, I would hope. The tests are looking great, we are at 215 total, and down to 18 failures. Quite some of the current failures are from non-implemented, as I've begun using them as todo's.

Actually, I like doing that. When typing todo in a comment in the code, it disappears in the noise. But a red test, well, that can neither be avoided nor forgotten.

On a different note, I have some days vacation now. The easter is a holiday in Denmark, and I used some vacation days to get extend the vacation. So I should have the time to finish up this project, or at least get it to a point where I can look at some of the other ideas I have. Such as the iPad.

Read more

Work in Progress

This blog post was written while the blog system itself was still under construction, and might not reflect the final product. But it does illuminate and document my thoughts at this point in time, so that's just fine by me ^^.

At this moment in time, the blog is still pretty much not functional. Sunday evening I attempted to put it to a real-life test, and a number of bugs and flaws in the design reared their heads. So I pulled it back, and implemented a number of other tests.

Right now, there are a total of 124 specs in the test-runner, and 27 fails. Most of these are unimplemented tests, and the rest relates to unwritten code or code that was broken in the recent refactoring. All in all, not too shabby.

Read more