January 4, 2013
Moving To Blogger

I will be logging at http://weblog.hataewon.com. Old entries from here will be gradually copied.

January 3, 2013
Qmind 0.0.10

Over the last two weeks I found some time to work on my small Cocoa project Qmind, a mind-mapping app for OS X:

Finally, arrow keys can be used to change the selection. And icons can be inserted. However, the deletion of icons will come in version 0.0.10 + X, where X > 0.

9:18pm  |   URL: http://tmblr.co/Z-oSPxatbC3Q
Filed under: qmind qvacua 
December 31, 2012
2010 Marrenon Rouge
B+
4,30 €

2010 Marrenon Rouge

  • B+
  • 4,30 €

10:22pm  |   URL: http://tmblr.co/Z-oSPxaePZpy
Filed under: wine 
December 31, 2012
2011 Château Pech-Céleyran La Clape
B+
4,80 €

2011 Château Pech-Céleyran La Clape

  • B+
  • 4,80 €

10:19pm  |   URL: http://tmblr.co/Z-oSPxaeO_H8
Filed under: wine 
December 31, 2012
Removing Multiple Entries From “Open With”

/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.fram ework/Support/lsregister -kill -r -domain local -domain system -domain user

Then, relaunch Finder.

10:13pm  |   URL: http://tmblr.co/Z-oSPxaeNGnO
Filed under: osx 
December 29, 2012
Node.js Static HTTP Server

Since http://qvacua.com consists of only static files, the following node.js static HTTP server comes in handy

HOST = null; // null => localhost
PORT = 8000;

HTTP_STATUS_OK = 200;
HTTP_STATUS_NOT_FOUND = 404;

var http = require("http"),
    url = require("url"),
    path = require("path"),
    fs = require("fs");

function writeNotFound(response) {
    response.writeHead(HTTP_STATUS_NOT_FOUND, {
        "Content-Type": "text/plain"
    });
    response.end("Not Found");
}

function writeBinary(data, response) {
    response.writeHead(HTTP_STATUS_OK);
    response.write(data, "binary");
    response.end();
}

function writeIndexHtml(filename, response) {
    var indexFilename = path.join(filename, 'index.html');

    fs.exists(indexFilename, function (exists) {
        if (!exists) {
            writeNotFound(response);
            return;
        }

        fs.readFile(indexFilename, function (error, data) {
            writeBinary(data, response);
        });

    });
}

var server = http.createServer(function (request, response) {
    var uri = url.parse(request.url).pathname;
    var filename = path.join(process.cwd(), uri);

    fs.stat(filename, function (error, stats) {
        if (error) {
            writeNotFound(response);
            return;
        }

        if (stats.isDirectory()) {
            writeIndexHtml(filename, response);
            return;
        }

        fs.readFile(filename, function (error, data) {
            writeBinary(data, response);
        });
    });
});

server.listen(PORT, HOST);
console.log("Server @ http://" + (HOST || "localhost") + ":" + PORT);

By default index.html will be served when the URL directs to a folder. It does not have error handling whatsoever: sufficient for development.

9:15pm  |   URL: http://tmblr.co/Z-oSPxaTUCid
Filed under: nodejs 
December 26, 2012
Anema E Core Trattoria

Lohengrinstraße 11, 81925 München, Germany, anema-e-core.com

  • J: Pizza with vegetables, C+
  • T: Saltimbocca alla Romana (Kalbsmedaillons mit Parmaschinken und Salbei), B

9:56pm  |   URL: http://tmblr.co/Z-oSPxaE886z
Filed under: restaurant 
December 26, 2012
2004 Solís Diego de Almagro Gran Reserva
B+
7,40 €

2004 Solís Diego de Almagro Gran Reserva

  • B+
  • 7,40 €

9:50pm  |   URL: http://tmblr.co/Z-oSPxaE6bRI
  
Filed under: wine 
December 21, 2012
Mocking Class Method in Objective-C

Once in a while, when testing your Objective-C code, you want or have to mock a class method. Or you want to replace the implementation of a class method. The following code replaces the implementation of originalClassMethod of SomeClass with the implementation of mockClassMethod of MockClass:

Method mockMethod = class_getInstanceMethod([MockClass class], @selector(mockClassMethod));
IMP mockImpl = method_getImplementation(mockMethod);
Method originalMethod = class_getClassMethod([SomeClass class], @selector(originalClassMethod));
IMP originalImpl = method_setImplementation(originalMethod, testImpl);

Don’t forget to import objc/runtime.h.

December 21, 2012
2011 Farnese Sangiovese
B+
4,40 €

2011 Farnese Sangiovese

  • B+
  • 4,40 €

9:36pm  |   URL: http://tmblr.co/Z-oSPxZrzA5b
Filed under: wine 
December 21, 2012
Git Submodule Cheat Sheet

  • Adding a new submodule
    git submodule add git://URL/TO/SUBMODULE.git SUMMODULE_NAME
  • Getting, ie downloading, the newly added submodule
    git submodule init
  • Updating all submodules
    git submodule update
  • Make changes to a submodule
    1. cd SUBMODULE
    2. git checkout master (or whatever branch you want to edit)
    3. code ... code ... code ...
    4. git commit
    5. git push
    6. cd .. (go to the parent repo)
    7. git commit SUBMODULE
    8. git push

9:31pm  |   URL: http://tmblr.co/Z-oSPxZrxrVg
Filed under: git 
December 19, 2012
2009 Principe de Viana Crianza
A-
5,90 €

2009 Principe de Viana Crianza

  • A-
  • 5,90 €

8:40pm  |   URL: http://tmblr.co/Z-oSPxZi3p4q
Filed under: wine 
December 19, 2012
2011 Casabianca Sussingo
C-
5,95 €

2011 Casabianca Sussingo

  • C-
  • 5,95 €

8:38pm  |   URL: http://tmblr.co/Z-oSPxZi3R95
Filed under: wine 
December 19, 2012
2010 Seigneurie de Peyrat Classique
A-
6,90 €

2010 Seigneurie de Peyrat Classique

  • A-
  • 6,90 €

8:36pm  |   URL: http://tmblr.co/Z-oSPxZi2sfb
Filed under: wine 
December 19, 2012
2007 Espinosa Cencipeñas Crianza
C+
4,95 €

2007 Espinosa Cencipeñas Crianza

  • C+
  • 4,95 €

8:32pm  |   URL: http://tmblr.co/Z-oSPxZi1zUa
Filed under: wine