Duration to execute code in Objectice-C

This code snippet outputs the time which is needed to execute some code.

- (void)someAction {

  // save current time
  CFAbsoluteTime startTime = CFAbsoluteTimeGetCurrent();

  [self someAwesomeAlgorithm];

  // print time difference to console
  // output Example: Took 0.000078 seconds.
  NSLog(@"Took %f seconds.", (CFAbsoluteTimeGetCurrent()-startTime));
}

Mac / iPhone / iPad programming ressources list

I started to build apps for the iPhone. Here are some ressources which are useful to know.

Tutorials

Code snippets

Communities

 

List will be extended. If you know additional links, post them in the comments, I will add them.

Updates:

  • 2012-01-08: Added code snippets, video tutorials
  • 2012-01-10: Added code snippets, communities
  • 2012-01-14: Added code snippets, tutorials

URL-Fingerprinting für optimales Cacheing

Mit Hilfe von URL-Fingerprinting ist es möglich, Dateien sehr lange zu cachen (für ein Jahr), jedoch auch gleichzeitig eine Änderung ohne Wartezeit zu publizieren. Was darunter genau zu verstehen ist und wie eine Implementierung aussehen könnte, zeigt dieser Artikel auf.

Read more »

Probleme bei der Installation von Xcode 4

XCode ist die IDE (Integrierte Entwicklungsumgebung) von Apple für Software. Bei der aktuellen Version kommt es zu Problemen bei der Installation. Wie diese Probleme behoben werden können und man eine fehlerhafte Version entfernt, beschreibt dieser Artikel.

Read more »

Mac OS X zur Webentwicklung nutzen: Schnell und einfach Apache, PHP, MySql und SVN einrichten.

Unter Mac OS X entwickeln macht Spaß. Und das eigenen System einzurichten geht erstaunlich schnell, da Mac OS X bereits mit einem Apache 2.2 Webserver, PHP 5 und auch mit einem SVN Server ausgeliefert wird. Wie diese unkompliziert eingerichtet werden können soll hier gezeigt werden.

Read more »

Setting up SVN on Mac OS X – Quick & Easy

You’ll find quite a lot of guides showing you how to install an svn server on your Mac OS X machine. But most of them don’t tell you, that Mac OS X ships with a fully functional svn system. This is how you configure it.

Read more »

Backup your files using tar and cronjobs on Mac OS X

Mac OS X comes with a huge amount of useful stuff. You just need to find and use them. Here is a walkthrough showing you how to set up an automatically backup-system on Mac OS X.

There are several ways to backup your files and probably the best way to do it would be to use rsync. It allows you to backup your files onto a remote machine. But probably this is a bit to heavy for the task you most probably want to achieve: Backup a folder on your local harddrive on a regular basis.

Read more »

Using -webkit and/or -moz Styles with mootools.

In order to use -webkit and/or -moz style CSS3 attributes such as ‘-webkit-transform’ or ‘-moz-rounded-border’ to generate rounded borders, transformations etc. you have to extend the mootools Element.Styles hash. Doing this enables you to use the Element.setStyle() method. You can even use the whole mootools effects library and tween -webkit and/or -moz styles.

Element.Styles.extend({
	WebkitTransform: 'rotateX(@deg)'
});

The styles property-name has to be given camelCases. Thus ‘-webkit-transform’ has to be given as ‘WebkitTransform’. Specify how the property has to be set by defining a string like ‘rotateX(@deg)’ and leaving the @ to be replaced by the value you set the css property to.

Read on for an example. Read more »

Punkte in Google-Mail-Adressen

Registriert man bei Google Mail eine E-Mailadresse – z.B. dasIstEineEMailAdresse@googlemail.com – so wird der komplette Benutzername unabhängig von Groß-/Kleinschreibung und Punkten (.) interpretiert: registriert man die E-Mail-Adresse dasIstEineEMailAdresse@googlemail.com, so hat man automatisch auch folgende weitere Adressen das.ist.eine.emailadresse@googlemail.com oder das.istEineEmailAdresse@googlemail.com etc.

Welche Vorteile sich für den Benutzer und welche Nachteile für einen Webmaster sich hierdurch ergeben soll hier kurz aufgezeigt werden.

Read more »

PHP und Geolocation – Lokalisierung leicht gemacht

Ein Besuch auf www.regnets.in zeigt kurz und knapp die aktuelle Wetterlage für den Standort des Besuchers an. Ermöglicht wird das über Geolocation anhand der IP-Adresse des Benutzers. Natürlich kann der Benutzer auch andere Städte abfragen: www.regnets.in/Hamburg oder www.regnets.in/Berlin.

Geolocation lässt sich beispielsweise mit (kostenlosen) GeoLite City von MaxMind sehr einfach in PHP-Projekte integrieren. Mit nur wenigen Dateien und wenigen Zeilen Code lässt sich so der Standort des Besuchers relativ genau (für Deutschland mit 71% Trefferquote) bestimmen. Read more »