<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description>Well, this is embarrassing. You might have expected to find my homepage here. In fact I am currently too busy studying, writing iOS apps or working on other projectserver.org projects to create my own homepage. You may return whenever you like to check if that has changed somehow. Up to then, everything you find here is just a sophisticated twitter newsfeed. Enjoy.</description><title>xcuze.me - home of florian krueger</title><generator>Tumblr (3.0; @xcuze)</generator><link>http://xcuze.me/</link><item><title>"Computers are like air conditioners - they stop working properly if you open Windows."</title><description>“Computers are like air conditioners - they stop working properly if you open Windows.”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;read on a T-Shirt&lt;/em&gt;</description><link>http://xcuze.me/post/14558673035</link><guid>http://xcuze.me/post/14558673035</guid><pubDate>Wed, 21 Dec 2011 12:12:00 +0100</pubDate></item><item><title>MultiMarkDown LaTeX Export with Byword</title><description>&lt;p&gt;I really love &lt;strong&gt;Byword&lt;/strong&gt; (&lt;a title="Byword: A simple typing interface." target="_blank" href="http://bywordapp.com"&gt;bywordapp.com&lt;/a&gt;) by metaclassy and the &lt;a title="MultiMarkdown User's Guide" target="_blank" href="https://github.com/fletcher/MultiMarkdown/blob/master/Documentation/MultiMarkdown%20User%27s%20Guide.md"&gt;MultiMarkDown&lt;/a&gt; (MMD) to LaTeX Export feature is simply &lt;strong&gt;awesome&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Here&amp;#8217;s one thing that really annoys me though:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_lpq0bhmCHL1qg3kmm.png"/&gt;&lt;/p&gt;</description><link>http://xcuze.me/post/8737078457</link><guid>http://xcuze.me/post/8737078457</guid><pubDate>Wed, 10 Aug 2011 18:27:57 +0200</pubDate><category>LaTeX</category><category>MultiMarkDown</category><category>Byword</category><category>App</category><category>Export</category></item><item><title>"Java is a high level programming language. It’s unproductive to have an opinion about it."</title><description>“Java is a high level programming language. It’s unproductive to have an opinion about it.”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;Nick Farina in &lt;a href="http://nfarina.com/post/8239634061/ios-to-android"&gt;http://nfarina.com/post/8239634061/ios-to-android&lt;/a&gt;&lt;/em&gt;</description><link>http://xcuze.me/post/8425266054</link><guid>http://xcuze.me/post/8425266054</guid><pubDate>Wed, 03 Aug 2011 13:45:19 +0200</pubDate><category>java</category><category>programming</category></item><item><title>"Java was like having a rich lawyer as a brother. He was fun when he was younger, but now he’s..."</title><description>“Java was like having a rich lawyer as a brother. He was fun when he was younger, but now he’s a black hole that sucks away all the joy in a 100-mile radius.”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;Bruce A. Tate - Seven Languages in Seven Weeks&lt;/em&gt;</description><link>http://xcuze.me/post/6823530514</link><guid>http://xcuze.me/post/6823530514</guid><pubDate>Thu, 23 Jun 2011 13:26:35 +0200</pubDate><category>programming</category><category>java</category><category>fun</category></item><item><title>Why NoSQL is bad for startups</title><description>&lt;a href="http://labs.mudynamics.com/2010/04/01/why-nosql-is-bad-for-startups/"&gt;Why NoSQL is bad for startups&lt;/a&gt;: &lt;p&gt;&lt;span&gt; &lt;/span&gt;&lt;/p&gt;
April 1st, 2010 by kowsik
&lt;p&gt;We launched &lt;a href="http://www.pcapr.net/"&gt;&lt;strong&gt;pcapr&lt;/strong&gt;&lt;/a&gt; over a year ago now with just a few of us working part time to build and manage the site. pcapr is powered by &lt;a href="http://couchdb.apache.org/"&gt;CouchDB&lt;/a&gt;, a NoSQL database written in Erlang with JavaScript as the primary query language. Frankly, this has been a disaster. We are planning on rebuilding the site with Java, Hibernate and MySQL for a number of reasons. [&lt;a title="Why NoSQL is bad for startups" target="_blank" href="http://labs.mudynamics.com/2010/04/01/why-nosql-is-bad-for-startups/"&gt;read more&lt;/a&gt;]&lt;/p&gt;</description><link>http://xcuze.me/post/5476857351</link><guid>http://xcuze.me/post/5476857351</guid><pubDate>Sat, 14 May 2011 13:18:11 +0200</pubDate><category>NoSQL</category><category>Technology</category><category>fun</category></item><item><title>"… if your only tool is a hammer, every problem looks like a nail."</title><description>“… if your only tool is a hammer, every problem looks like a nail.”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;Reuven M. Lerner in “At the Forge - NoSQL? I’d Prefer SomeSQL”&lt;/em&gt;</description><link>http://xcuze.me/post/4800508234</link><guid>http://xcuze.me/post/4800508234</guid><pubDate>Thu, 21 Apr 2011 08:51:46 +0200</pubDate></item><item><title>Snippet: Running Tasks in the Background While Updating the UI</title><description>&lt;p&gt;This is just a very quick note about multithreading in iOS 4.0+. If you want to put a long-running task to the background but keep your users updated about the state of the task you can use this snippet.&lt;/p&gt;
&lt;pre class="brush: objc"&gt;// start background execution
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
            
      // do background work here (e.g. in a loop)
            
      // everytime you want to update the ui call this
      dispatch_async(dispatch_get_main_queue(), ^{
                
            // update your ui here .. e.g.
            [myUIProgressView setProgress:myProgress];
            // you need to provide these variables yourself of course ;)
                
      });
});
&lt;/pre&gt;</description><link>http://xcuze.me/post/4392308404</link><guid>http://xcuze.me/post/4392308404</guid><pubDate>Wed, 06 Apr 2011 18:15:00 +0200</pubDate><category>ios</category><category>iphone</category><category>uiprogessview</category><category>multithreading</category><category>short</category><category>snippet</category></item><item><title>ComboBox like UITableViewCells</title><description>&lt;p&gt;&lt;img height="320" width="720" align="middle" src="http://media.tumblr.com/tumblr_lj53fzY5L31qg3kmm.png"/&gt;&lt;/p&gt;
&lt;p&gt;When I came across the &lt;a target="_blank" href="http://itunes.apple.com/de/app/twitter/id333903271?mt=8"&gt;Twitter App for iPhone&lt;/a&gt;, I saw something I immediately wanted to have for my own app: UITableViewCells acting like ComboBoxes, opening on tap, closing when a new option is chosen. The idea was so nice that I decided to write a small prototype which can now be found at a &lt;a target="_blank" href="https://github.com/floriankrueger/iOS-Examples--UITableView-Combo-Box"&gt;public github repository&lt;/a&gt; of mine. There is also some basic documentation that might be useful for those who want to re-implement this code.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The key facts in a nutshell:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;You need a custom UITableViewCell in order to display a status indicator as shown in the &amp;#8220;screenshot&amp;#8221; above and to make it easier to maintain a status within the UITableViewCell itself. There are plenty of tutorials on the web demonstrating how to create those custom UITableViewCells and loading them from a XIB file.&lt;/li&gt;
&lt;li&gt;Everytime you change the rowcount in a section (insert or delete cells) you need to adjust the number that &amp;#8216;numberOfRowsInSection&amp;#8217; returns so you can check the state of your ComboBox cell and return the number of options in that cell plus 1 for the cell itself if the state is &amp;#8216;open&amp;#8217;. If you don&amp;#8217;t adjust this value, you run into an inconsistency exception.&lt;/li&gt;
&lt;li&gt;Although the option cells are not visible from the start, you need to return these cells from the &amp;#8216;cellForRowAtIndexPath&amp;#8217; method. A good way to realize a dynamic number of option cells is to make use of the &amp;#8216;default&amp;#8217; statement in the switch and only specify a static cell for the first row in that section (id 0).&lt;/li&gt;
&lt;/ul&gt;&lt;pre class="brush: objc"&gt;            switch ([indexPath row]) {
                case 0: {
                 
                    // return the ComboBox cell here
                    
                    break;
                }
                default: {
                    
                    // return the Option cells here
                    
                    break;
                }
            }&lt;/pre&gt;
&lt;p&gt;If you&amp;#8217;re interested, feel welcome to check the full prototype and it&amp;#8217;s documentation in the repository.&lt;/p&gt;</description><link>http://xcuze.me/post/4342967883</link><guid>http://xcuze.me/post/4342967883</guid><pubDate>Mon, 04 Apr 2011 20:03:26 +0200</pubDate><category>iOS</category><category>XCode</category><category>UITableViewCell</category><category>ComboBox</category><category>DropDown</category><category>UITableView</category><category>Example</category><category>Tutorial</category></item><item><title>"The only thing necessary for the triumph of evil is for good men to do nothing."</title><description>“The only thing necessary for the triumph of evil is for good men to do nothing.”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;Edmund Burke&lt;/em&gt;</description><link>http://xcuze.me/post/3804120133</link><guid>http://xcuze.me/post/3804120133</guid><pubDate>Sat, 12 Mar 2011 11:43:14 +0100</pubDate></item><item><title>Introduction to NSPredicate</title><description>&lt;p&gt;As I continued to work on my &lt;a title="Rumford1797 @ AppStore" target="_blank" href="http://j.mp/eIhLOL"&gt;Rumford1797 app&lt;/a&gt; I made heavy usage of an Cocoa framework component called NSPredicate. Most of you that have come across NSPredicate have seen it in combination with CoreData when fetching objects from the persistent store. That was my first point of contact with it as well but lately I discovered that it is also useful for cleansing your code when working with any amount of data stored in structures like NSSet or NSArray.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;WHAT IS NSPREDICATE?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;NSPredicate is basically a predicate to filter objects. The advantage is, that it can be used to filter many collections of objects, e.g. NSSet or NSArray.&lt;/p&gt;
&lt;pre class="brush: objc"&gt;// create an array of (ns)strings
NSArray *looneyTunes = [NSArray arrayWithObjects:@"Bugs Bunny", @"Daffy Duck", @"Elmer Fudd", nil];
	
// create a predicate that looks for objects that begin with the character 'B'
NSPredicate *beginsWithB = [NSPredicate predicateWithFormat:@"SELF beginswith[c] 'B'"];
	
// this is where the magic happens
NSArray *looneyTunesThatBeginWithB = [looneyTunes filteredArrayUsingPredicate:beginsWithB];
	
// returns 'Results: 1'
NSLog(@"Results: %d", [looneyTunesThatBeginWithB count]);&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;EXAMPLES&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;As you can see, filtering an array by a simple predicate is just a single line of code. Even the most complex predicates work like this. So lets pretend we have an objectset of a class called &lt;code&gt;LooneyTune&lt;/code&gt; that has the following structure:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_lgnm83PamY1qg3kmm.png"/&gt;&lt;/p&gt;
&lt;p&gt;Now we want to retrieve these objects from an array that have &lt;code&gt;'Bunny'&lt;code&gt; as &lt;code&gt;lastName&lt;/code&gt;.&lt;/code&gt;&lt;/code&gt;&lt;/p&gt;
&lt;pre class="brush: objc"&gt;NSArray *looneyTunes = [NSArray arrayWithObjects:bugsBunny,honeyBunny,lolaBunny,elmerFudd,nil];
NSPredicate *lastNameBunny = [NSPredicate predicateWithFormat:@"lastName like[c] 'Bunny'"];
NSArray *bunnies = [looneyTunes filteredArrayUsingPredicate:lastNameBunny];
	
// returns 'Results: 3'
NSLog(@"Results: %d", [bunnies count]);&lt;/pre&gt;
&lt;p&gt;That was again easy, wasn&amp;#8217;t it? The next and last example will show you that it is also very easy to use more complex data types as strings like NSDate in you NSPredicates. Let&amp;#8217;s say we want to find all LooneyTunes characters that had their first appearance before November 1st, 1966&lt;/p&gt;
&lt;pre class="brush: objc"&gt;NSDate *date1966 = [NSDate dateWithNaturalLanguageString:@"November 1, 1966"];
NSPredicate *appearanceBefore1966 = [NSPredicate predicateWithFormat:@"firstAppearance &amp;lt; %@",date1966];
NSArray *firstLooneyTunes = [looneyTunes filteredArrayUsingPredicate:appearanceBefore1966];
	
// returns 'Results: 2'
NSLog(@"Results: %d", [firstLooneyTunes count]);&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;ONE MORE THING ..&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;You might have guessed it but I felt the need to emphasize on this: You are able to combine multiple predicates with logical operators like &lt;code&gt;AND&lt;/code&gt; and &lt;code&gt;OR&lt;/code&gt;. A quick example will show you what I mean:&lt;/p&gt;
&lt;pre class="brush: objc"&gt;NSPredicate *filter = [NSPredicate predicateWithFormat:@"(start &amp;gt;= %@) AND (end &amp;lt;= %@)", earlyDate, lateDate];&lt;/pre&gt;
&lt;p&gt;This simple line of code is able to extract objects (having the properties &lt;code&gt;start&lt;/code&gt; and &lt;code&gt;end&lt;/code&gt;) that are valid in a given period which is limited by &lt;code&gt;earlyDate&lt;/code&gt; and &lt;code&gt;lateDate&lt;/code&gt;. In my experience, this method is faster and much more reliable compared to a &amp;#8216;for&amp;#8217; loop or similar classical approaches for this purpose.&lt;/p&gt;
&lt;p&gt;For more information about NSPredicate and its usage please refer to the &lt;a title="Predicates Programming Guide" target="_blank" href="http://bit.ly/h4AkWA"&gt;Predicates Programming Guide&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;(The name LooneyTunes and the LooneyTunes characters which have been used for the code examples are property of Warner Bros.)&lt;/p&gt;</description><link>http://xcuze.me/post/3315481271</link><guid>http://xcuze.me/post/3315481271</guid><pubDate>Tue, 15 Feb 2011 23:31:58 +0100</pubDate><category>iPhone</category><category>iOS</category><category>development</category><category>tutorial</category><category>NSPredicate</category><category>CoreData</category></item><item><title>"With all the things I know, one could write a book… Although, one might also say that,..."</title><description>“With all the things I know, one could write a book… Although, one might also say that, considering all that I don’t know, one could create a library”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;&lt;span&gt;Sacha Guitry&lt;/span&gt;&lt;/em&gt;</description><link>http://xcuze.me/post/3293039385</link><guid>http://xcuze.me/post/3293039385</guid><pubDate>Mon, 14 Feb 2011 17:36:12 +0100</pubDate><category>knowledge</category><category>random</category></item><item><title>"Artificial Intelligence is the study of how to make computers do things at which, at the moment,..."</title><description>“Artificial Intelligence is the study of how to make computers do things at which, at the moment, people are better.”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;&lt;span class="text_exposed_show"&gt;Elaine Rich&lt;/span&gt;&lt;/em&gt;</description><link>http://xcuze.me/post/3200408353</link><guid>http://xcuze.me/post/3200408353</guid><pubDate>Wed, 09 Feb 2011 18:15:01 +0100</pubDate><category>computer_science</category></item><item><title>Using the AddressBook API to scan for contact details on iOS 4.0+</title><description>&lt;p&gt;&lt;strong&gt;OBJECTIVES&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This quick tutorial will show you the basic usage of the AddressBook API of iOS and give you an example how to&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;obtain a list of all contacts in the address book&lt;/li&gt;
&lt;li&gt;access a contact&lt;/li&gt;
&lt;li&gt;access details of a contact&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;OUT OF SCOPE&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In this article I will not show how to modify data or present it with the built-in view controllers. The first thing is too much for a quick start and the second thing is very good documented in the official &lt;a title="Address Book programming guide" target="_blank" href="http://developer.apple.com/library/ios/#documentation/ContactData/Conceptual/AddressBookProgrammingGuideforiPhone/Introduction.html#//apple_ref/doc/uid/TP40007744"&gt;Apple docs&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;PRELIMINARIES&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Before you can start accessing your address book you need to add two frameworks to your project: &lt;a title="AddressBook" target="_blank" href="http://developer.apple.com/library/ios/#documentation/AddressBook/Reference/AddressBook_iPhoneOS_Framework/_index.html#//apple_ref/doc/uid/TP40007212"&gt;AddressBook&lt;/a&gt; and &lt;a title="AddressBookUI" target="_blank" href="http://developer.apple.com/library/ios/#documentation/AddressBookUI/Reference/AddressBookUI_Framework/_index.html"&gt;AddressBookUI&lt;/a&gt;. Also, do not forget to insert some test-contacts into the contacts app of the simulator as you might not want to test address book operations directly on your real address book.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;GETTING STARTED&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The first thing you need is the reference to your address book. There is a nice function in the API that does that work for you.&lt;/p&gt;
&lt;pre class="brush: objc"&gt;ABAddressBookRef addressBook = ABAddressBookCreate();&lt;/pre&gt;
&lt;p&gt;Now that was an easy start, wasn&amp;#8217;t it? Next thing you need is to query the address book reference for some data. As I just want to give a simple example here I am querying for a list of all contacts.&lt;/p&gt;
&lt;pre class="brush: objc"&gt;NSArray *people = (NSArray *)ABAddressBookCopyArrayOfAllPeople(addressBook);&lt;/pre&gt;
&lt;p&gt;As you might have guessed, this function copies all of the contact information of all contacts from the address book into an array which might then be type-casted into a NSArray.&lt;/p&gt;
&lt;p&gt;But what exactly is now pulled from the address book and stored inside the NSArray? The answer: ABRecordRef objects. These objects are generic wrappers around all kinds of entries in the address book, hence &amp;#8216;record&amp;#8217;.&lt;/p&gt;
&lt;p&gt;By now, it is already possible to determine the number of contacts in the address book as each of the ABRecordRef objects represents one contact. To check whether there have been pulled some contacts at all, one could simply use something like&lt;/p&gt;
&lt;pre class="brush: objc"&gt;if ((people != nil) &amp;amp;&amp;amp; [people count]) { 
	/* do something */ 
}&lt;/pre&gt;
&lt;p&gt;The next step would be to select a single record from the NSArray which I will do with a simple for loop to iterate over all records.&lt;/p&gt;
&lt;pre class="brush: objc"&gt;for (int i=0 ; i &amp;lt; [people count];i++) {
	ABRecordRef ref = (ABRecordRef)[people objectAtIndex:i];
}&lt;/pre&gt;
&lt;p&gt;Up to now nothing really magical has happened and this is not going to change very much. However, the next part is the part which cost me an hour or so to figure out because there is a small lack of information concerning E-Mail addresses in the documentation.&lt;/p&gt;
&lt;p&gt;Before we continue, I have to explain what ABSingleValueRefs and ABMultiValueRefs are. In the AddressBook API, there is a difference between properties which can only contain a single value (e.g. &amp;#8216;Last Name&amp;#8217;) and properties which contain more than one value (e.g. &amp;#8216;Addresses&amp;#8217;). Single value properties are directly accessed via their key (e.g. &amp;#8216;&lt;code&gt;kABPersonFirstNameProperty')&lt;/code&gt;:&lt;/p&gt;
&lt;pre class="brush: objc"&gt;CFStringRef first = ABRecordCopyValue(someRecord, kABPersonFirstNameProperty); 
CFStringRef last  = ABRecordCopyValue(someRecord, kABPersonLastNameProperty);&lt;/pre&gt;
&lt;p&gt;Multi value properties are accessed by a key as well but as they return more than one value they have to be temporary stored inside another NSArray:&lt;/p&gt;
&lt;pre class="brush: objc"&gt;ABMultiValueRef emails = ABRecordCopyValue(someRecord, kABPersonEmailProperty); 
NSArray *mailAdresses = (NSArray *)ABMultiValueCopyArrayOfAllValues(emails);&lt;/pre&gt;
&lt;p&gt;Afterwards, each value can be extracted in some kind of a loop, for example another for loop:&lt;/p&gt;
&lt;pre class="brush: objc"&gt;for (int j=0 ; j&amp;lt;[mailAdresses count] ; j++) { 
	NSString *emailAddress = (NSString *)[mailAdresses objectAtIndex:j]; 
}&lt;/pre&gt;
&lt;p&gt;For more information on which keys are available and to which of the two categories they belong, please refer to the &lt;a title="Address Book programming guide" target="_blank" href="http://developer.apple.com/library/ios/#documentation/ContactData/Conceptual/AddressBookProgrammingGuideforiPhone/Introduction.html#//apple_ref/doc/uid/TP40007744"&gt;official documentation&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;EXAMPLE CODE&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This is the complete code of the example with some NSLog() output:&lt;/p&gt;
&lt;pre class="brush: objc"&gt;// Fetch the address book
ABAddressBookRef addressBook = ABAddressBookCreate();
// get all people from the addressbook
NSArray *people = (NSArray *)ABAddressBookCopyArrayOfAllPeople(addressBook);
if ((people != nil) &amp;amp;&amp;amp; [people count]) {
	NSLog(@"%d contacts have been extracted from the address book", [people count]);
	for (int i=0;i &amp;lt; [people count];i++) {	
		ABRecordRef ref = (ABRecordRef)[people objectAtIndex:i];
		ABMultiValueRef emails = ABRecordCopyValue(ref, kABPersonEmailProperty);
		NSArray *mailAdresses = (NSArray *)ABMultiValueCopyArrayOfAllValues(emails);
		NSLog(@"contact %d has %d E-Mail addresses",i,[mailAdresses count]);
		for (int j=0;j &amp;lt; [mailAdresses count];j++) {
			NSString *emailAddress = (NSString *)[mailAdresses objectAtIndex:j];
			NSLog(@"address %d: %@", j, emailAddress);
		}
	}
} else {
	NSLog(@"No contacts have been extracted from the address book");		
}
[people release];
CFRelease(addressBook);&lt;/pre&gt;</description><link>http://xcuze.me/post/3190909712</link><guid>http://xcuze.me/post/3190909712</guid><pubDate>Wed, 09 Feb 2011 02:51:00 +0100</pubDate><category>iPhone</category><category>iOS</category><category>development</category><category>tutorial</category></item></channel></rss>

