<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Language and Computation &#187; programming</title>
	<atom:link href="http://omlog.wordpress.com/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://omlog.wordpress.com</link>
	<description>Academia, Linguistics, Programming, and Personal stuff</description>
	<lastBuildDate>Wed, 30 Dec 2009 15:48:47 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='omlog.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/917cbe660078eb237d18a172ca969b9c?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Language and Computation &#187; programming</title>
		<link>http://omlog.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://omlog.wordpress.com/osd.xml" title="Language and Computation" />
		<item>
		<title>Go &#8211; Went &#8211; Gone</title>
		<link>http://omlog.wordpress.com/2009/12/30/go-went-gone/</link>
		<comments>http://omlog.wordpress.com/2009/12/30/go-went-gone/#comments</comments>
		<pubDate>Wed, 30 Dec 2009 15:48:47 +0000</pubDate>
		<dc:creator>ojmason</dc:creator>
				<category><![CDATA[erlang]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://omlog.wordpress.com/?p=125</guid>
		<description><![CDATA[I did play around with the unhelpfully named &#8216;go&#8217; programming language, another output of the don&#8217;t-be-evil company. Trying to find any web resources for it is pretty much impossible, for one thing because it was too new, and then because of the name.  I would have expected something more search-friendly from the number 1 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=omlog.wordpress.com&blog=2985839&post=125&subd=omlog&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I did play around with the unhelpfully named &#8216;go&#8217; programming language, another output of the don&#8217;t-be-evil company. Trying to find any web resources for it is pretty much impossible, for one thing because it was too new, and then because of the name.  I would have expected something more search-friendly from the number 1 web search engine!</p>
<p>There were a few things I liked about go.  It&#8217;s smallish, C-like, has garbage collection, built-in support for concurrency, and unicode strings.  Hash-tables (&#8216;maps&#8217;) as a first-class data type. A nicely-looking set of libraries for all sorts of purposes.  Not quite fast, but with lots of scope for performance improvements. No header files. First class support for unit tests.</p>
<p>This was looking attractive as opposed to Erlang, which is older and more mature/stable, but still not very high-performance, has slightly awkward string handling, and exactly three data types (list, tuple, atom).  And a Prolog-style syntax with a number of inconveniences about the use of commas, semicolons, and full stops.  Editing a clause is never straightforward.</p>
<p>I have since abandoned go again. It also has inconsistencies (the use of &#8216;new&#8217; for some data types and &#8216;make&#8217; for others), and worst of all, there was so much talk about wanting to add generics to the language that I fear they will become a feature of it.  I don&#8217;t like generics: they seem to me to be more trouble than it&#8217;s worth.  They make code really hard to read, and inflexible.  They might make some kinds of bugs impossible, but in my view that is a feeble gain for wrecking a language.  As Knuth (I think) said, part of writing programs is aesthetics.  I cannot like Java code full of abstract type annotations. Objective-C is so much cleaner in comparison.  And so was go, until now.</p>
<p>Another reason is the concurrency support. Go uses pipes for that, which seems awkward.  I much prefer Erlang&#8217;s mailboxes, which neatly work together with pattern matching to respond to certain messages and ignore others.  You do not need to worry about the order in which messages arrive as much, and the whole communication process is a lot easier with only the basic data types.</p>
<p>So I&#8217;m going back to Erlang. I will dig out the string library that I started, and get back into thinking recursively.  At least I know where I am with it, and it is not suddenly going to change!</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/omlog.wordpress.com/125/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/omlog.wordpress.com/125/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/omlog.wordpress.com/125/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/omlog.wordpress.com/125/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/omlog.wordpress.com/125/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/omlog.wordpress.com/125/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/omlog.wordpress.com/125/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/omlog.wordpress.com/125/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/omlog.wordpress.com/125/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/omlog.wordpress.com/125/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=omlog.wordpress.com&blog=2985839&post=125&subd=omlog&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://omlog.wordpress.com/2009/12/30/go-went-gone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b3e5e6b5ecd2707930a109a46c0cfafe?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ojmason</media:title>
		</media:content>
	</item>
		<item>
		<title>What&#8217;s a UITextEffectsWindow? And why is it receiving messages?</title>
		<link>http://omlog.wordpress.com/2009/09/17/whats-a-uitexteffectswindow-and-why-is-it-receiving-messages/</link>
		<comments>http://omlog.wordpress.com/2009/09/17/whats-a-uitexteffectswindow-and-why-is-it-receiving-messages/#comments</comments>
		<pubDate>Thu, 17 Sep 2009 09:10:39 +0000</pubDate>
		<dc:creator>ojmason</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://omlog.wordpress.com/?p=116</guid>
		<description><![CDATA[I just spent several hours (or at least it felt like several hours!) in frustration, searching a trivial bug.  I&#8217;ve been testing a quick&#8217;n'easy prototype screen with an UIImageView and four UIButtons.  The buttons are linked via an action to a view controller.  And every time I press a button, my app [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=omlog.wordpress.com&blog=2985839&post=116&subd=omlog&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I just spent several hours (or at least it felt like several hours!) in frustration, searching a trivial bug.  I&#8217;ve been testing a quick&#8217;n'easy prototype screen with an UIImageView and four UIButtons.  The buttons are linked via an action to a view controller.  And every time I press a button, my app conks out complaining that -[UITextEffectsWindow buttonPressed:] was an unrecognised selector.  I checked the memory address, and it said it was my view controller, just before that exception was thrown.</p>
<p>I was ready to put the blame on some mistakes with Interface Builder, until I came across the solution (indirectly) in a blog: here the problem described related to properties, and the difference between &#8220;vc = &#8230;&#8221; and &#8220;self.vc = &#8220;.  I had another look at my code and quickly found the offending line: I had the view controller as a local variable in the app delegates viewDidLoad method, and I autoreleased it.  In other words, by the time the button was pressed the view controller no longer existed, and hence I got that weird error message.</p>
<p>This was not helped by the fact that UITextEffectsWindow is not mentioned in the documentation anywhere, as it seems to be an internal UIKit class, but at least it appears to be consistent.</p>
<p>So, if your button presses send messages to UITextEffectsWindow, make sure to check that your view controller is still alive!</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/omlog.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/omlog.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/omlog.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/omlog.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/omlog.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/omlog.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/omlog.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/omlog.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/omlog.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/omlog.wordpress.com/116/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=omlog.wordpress.com&blog=2985839&post=116&subd=omlog&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://omlog.wordpress.com/2009/09/17/whats-a-uitexteffectswindow-and-why-is-it-receiving-messages/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b3e5e6b5ecd2707930a109a46c0cfafe?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ojmason</media:title>
		</media:content>
	</item>
		<item>
		<title>Application Promiscuity</title>
		<link>http://omlog.wordpress.com/2009/09/07/application-promiscuity/</link>
		<comments>http://omlog.wordpress.com/2009/09/07/application-promiscuity/#comments</comments>
		<pubDate>Mon, 07 Sep 2009 12:17:22 +0000</pubDate>
		<dc:creator>ojmason</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[objective-c]]></category>

		<guid isPermaLink="false">http://omlog.wordpress.com/?p=114</guid>
		<description><![CDATA[I was getting a bit bored with the slow progress on my Esperanto dictionary app, and over the holidays I started work on a few other ideas I had.  One was a Maths-drill program for kids, as the ones that are already out there (at least the ones I tried) don&#8217;t seem to be [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=omlog.wordpress.com&blog=2985839&post=114&subd=omlog&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I was getting a bit bored with the slow progress on my Esperanto dictionary app, and over the holidays I started work on a few other ideas I had.  One was a Maths-drill program for kids, as the ones that are already out there (at least the ones I tried) don&#8217;t seem to be ideal (nothing ever is ideal, though!).  So I tried writing another app so our kids could play and practice their maths skills.</p>
<p>That app is almost done, just the artwork and sound effects are missing.  At the moment it looks pretty rubbish (but looks aren&#8217;t that important as long as it works and doesn&#8217;t crash!), and the sound effects are nicked from somewhere, so I have to replace them with free ones.  Again, the purpose was to try things out.</p>
<p>That app was quite fun, and also easy to do.  More on that later&#8230;</p>
<p>The next app is one that supports teaching and learning students&#8217; names.  This makes use of a navigation controller, which is slow going.  I&#8217;m picking up loads of experience in Objective-C quirks along the way.  For example: avoid using NSNumbers as the keys in a dictionary if you want to save it using writeToFile later on&#8230;</p>
<p>Overall it&#8217;s very exciting, and the iPhone is a fun platform.  It&#8217;s really great to see your own stuff amongst all those polished apps, and provides great motivation to do better.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/omlog.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/omlog.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/omlog.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/omlog.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/omlog.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/omlog.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/omlog.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/omlog.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/omlog.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/omlog.wordpress.com/114/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=omlog.wordpress.com&blog=2985839&post=114&subd=omlog&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://omlog.wordpress.com/2009/09/07/application-promiscuity/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b3e5e6b5ecd2707930a109a46c0cfafe?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ojmason</media:title>
		</media:content>
	</item>
		<item>
		<title>NSData Naughtiness</title>
		<link>http://omlog.wordpress.com/2009/07/13/nsdata-naughtiness/</link>
		<comments>http://omlog.wordpress.com/2009/07/13/nsdata-naughtiness/#comments</comments>
		<pubDate>Mon, 13 Jul 2009 15:40:08 +0000</pubDate>
		<dc:creator>ojmason</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://omlog.wordpress.com/?p=112</guid>
		<description><![CDATA[Well, this is not exactly NSData&#8217;s fault, but I ran into a problem (for the second time; the first time I bypassed it with a short-cut) when reading text data from a file.
Occasionally there was random garbage at the end of a line, which I could not understand.  Incidentally, I was reading a number [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=omlog.wordpress.com&blog=2985839&post=112&subd=omlog&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Well, this is not exactly NSData&#8217;s fault, but I ran into a problem (for the second time; the first time I bypassed it with a short-cut) when reading text data from a file.</p>
<p>Occasionally there was random garbage at the end of a line, which I could not understand.  Incidentally, I was reading a number of full files in one go each into an NSData instance, and converted that into an NSString with the correct encoding; this I would then tokenise and add to another file.  So the garbage was actually at the end of each <em>file</em>.  I then found that I can directly initialise an NSString with the contents of a file, and the problem disappeared.</p>
<p>Now I want to produce concordance lines, and I jump into the middle of the file to read a stretch.  First I run into trouble with the encoding: as the data is UTF8-encoded, a random jump can end up in the middle of a multi-byte character. NSString does not like that&#8230; but here I can just test for that and skip the initial bytes.  The same problem obviously also happens at the end, where the final multi-byte character could be incomplete.  Again, truncation seems the easy way out.</p>
<p>But I also then had the issue with the occasional random garbage again!  NSData seems to be at fault, and this time I can&#8217;t bypass it, as NSString can only read a full file.  Quick websearch, and the solution crops up (in an aside) on <a href="http://stackoverflow.com/questions/550405/convert-nsdata-bytes-to-nsstring">stackoverflow.com</a>: the data that NSData returns from the -bytes method is not zero-terminated, but NSString&#8217;s -stringWithUTF8String expects that, hence the random garbage of the unterminated data.  In a way I&#8217;m surprised that it actually worked most of the time!</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/omlog.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/omlog.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/omlog.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/omlog.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/omlog.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/omlog.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/omlog.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/omlog.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/omlog.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/omlog.wordpress.com/112/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=omlog.wordpress.com&blog=2985839&post=112&subd=omlog&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://omlog.wordpress.com/2009/07/13/nsdata-naughtiness/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b3e5e6b5ecd2707930a109a46c0cfafe?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ojmason</media:title>
		</media:content>
	</item>
		<item>
		<title>Dictionary Dangers</title>
		<link>http://omlog.wordpress.com/2009/07/09/dictionary-dangers/</link>
		<comments>http://omlog.wordpress.com/2009/07/09/dictionary-dangers/#comments</comments>
		<pubDate>Thu, 09 Jul 2009 10:44:40 +0000</pubDate>
		<dc:creator>ojmason</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://omlog.wordpress.com/?p=108</guid>
		<description><![CDATA[I just spotted a bug that cost me several hours yesterday, without having a clue what was going on.  I&#8217;m currently working on a program which indexes texts, and as I encounter words, I add them to a NSMutableDictionary with their positions in the text.  All was working well, until I tested it [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=omlog.wordpress.com&blog=2985839&post=108&subd=omlog&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I just spotted a bug that cost me several hours yesterday, without having a clue what was going on.  I&#8217;m currently working on a program which indexes texts, and as I encounter words, I add them to a NSMutableDictionary with their positions in the text.  All was working well, until I tested it on a bunch of texts, and it failed with some obscure message about key-value coding.  I then added some NSLog messages, and discovered that the token it failed on was the at sign, @.</p>
<p>Today I had another look at the documentation of NSMutableDictionary, and especially the method valueForKey: where the problem seemed to occur.  And there it was: &#8220;<em>If key does not start with “@”, invokes objectForKey:. If key does start with “@”, strips the “@” and invokes [super valueForKey:] with the rest of the key.</em>&#8221;  Suddenly it dawned on me: I was using the wrong method.  Instead of <strong>value</strong>ForKey: I should have used <strong>object</strong>ForKey: &#8211; the plain @-sign is discarded, and leaves an empty key (which did of course make the error message less comprehensible, as I couldn&#8217;t really tell it was <em>empty</em>).</p>
<p>Quick change in the code, and it works.  Problem solved!</p>
<p>Lesson learned: always pay close attention to the available methods, and make sure it is the one you want, even if the one you&#8217;re using sounds like it&#8217;s the right one.  And read the docs carefully!</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/omlog.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/omlog.wordpress.com/108/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/omlog.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/omlog.wordpress.com/108/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/omlog.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/omlog.wordpress.com/108/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/omlog.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/omlog.wordpress.com/108/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/omlog.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/omlog.wordpress.com/108/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=omlog.wordpress.com&blog=2985839&post=108&subd=omlog&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://omlog.wordpress.com/2009/07/09/dictionary-dangers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b3e5e6b5ecd2707930a109a46c0cfafe?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ojmason</media:title>
		</media:content>
	</item>
		<item>
		<title>Making Progress!</title>
		<link>http://omlog.wordpress.com/2009/06/26/making-progress/</link>
		<comments>http://omlog.wordpress.com/2009/06/26/making-progress/#comments</comments>
		<pubDate>Fri, 26 Jun 2009 22:19:00 +0000</pubDate>
		<dc:creator>ojmason</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://omlog.wordpress.com/?p=105</guid>
		<description><![CDATA[DAY 11 and the pace is picking up.  I managed to sort out two of the four tabs of the app, one including a table display of Esperanto/English dictionary entries (with the proper Esperanto diacritics), and the other one being a live-search on the English gloss entries.  This one even pops up an [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=omlog.wordpress.com&blog=2985839&post=105&subd=omlog&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><strong>DAY 11</strong> and the pace is picking up.  I managed to sort out two of the four tabs of the app, one including a table display of Esperanto/English dictionary entries (with the proper Esperanto diacritics), and the other one being a live-search on the English gloss entries.  This one even pops up an automatic keyboard when first selected; the tab bar controller sends it a message when it has been activated. I even managed to answer a question on stackoverflow.com on that issue.</p>
<p>I also found somewhere a hint on how to automatically shrink the label size if the text is too long, wrote a converter from the Esperanto x-notation to unicode, etc.  Really pleased!  Both of these will appear here later.</p>
<p>One thing I don&#8217;t like too much is writing all the UITableViewDelegate methods when using a table.  Quite a lot of boiler-plate code, but then, it is quite powerful.  I just couldn&#8217;t be bothered writing yet another set of those methods for the final tab, the info view part.  But there is nothing technically difficult with it.  Objective-C is also getting easier and easier, and the auto-completion feature and API doc integration of XCode really helps.  Though I think for serious code I will still use vile&#8230;</p>
<p>That leaves pretty much only the core part of the app: the Esperanto morphological analyser.  I will implement this as a finite state machine, and working with Cocoa has given me the idea to implement it using delegates; an abstract hull which calls methods on the delegates whenever it needs to retrieve data, or match something.  I have the feeling that this is pretty similar to Erlang&#8217;s OTP frameworks.</p>
<p>It is a really rewarding experience to see your own app on the iPhone.  If only I was better at designing the tab bar icons!  And I can already foresee one objection: one of the tabs has a star icon, the star being the Esperanto symbol.  I think I need to change that, as the star is reserved for the &#8216;favourites&#8217; meaning, and I don&#8217;t think Apple would appreciate the use of a star (even if it looks slightly slimmer) with another meaning.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/omlog.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/omlog.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/omlog.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/omlog.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/omlog.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/omlog.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/omlog.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/omlog.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/omlog.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/omlog.wordpress.com/105/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=omlog.wordpress.com&blog=2985839&post=105&subd=omlog&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://omlog.wordpress.com/2009/06/26/making-progress/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b3e5e6b5ecd2707930a109a46c0cfafe?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ojmason</media:title>
		</media:content>
	</item>
		<item>
		<title>Every character is important</title>
		<link>http://omlog.wordpress.com/2009/06/23/every-character-is-important/</link>
		<comments>http://omlog.wordpress.com/2009/06/23/every-character-is-important/#comments</comments>
		<pubDate>Tue, 23 Jun 2009 22:02:16 +0000</pubDate>
		<dc:creator>ojmason</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://omlog.wordpress.com/2009/06/23/every-character-is-important/</guid>
		<description><![CDATA[DAY 10, and a little bit of progress.  I found one error, which was about to drive me mad, until I more or less by accident stumbled over the solution on stackoverflow.com; in answering a slightly different question, Rob Napier commented on a bug in the way NSLog() was used.
NSLog(@"Returning %@ rows", [nodes count]);
Here, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=omlog.wordpress.com&blog=2985839&post=100&subd=omlog&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><strong>DAY 10</strong>, and a little bit of progress.  I found one error, which was about to drive me mad, until I more or less by accident stumbled over the solution on stackoverflow.com; in answering a slightly different question, Rob Napier commented on a bug in the way NSLog() was used.<br />
<code>NSLog(@"Returning %@ rows", [nodes count]);</code><br />
Here, the -count method returns an int, but the %@ symbol expects an object.  Result: a bus error.  You need to use %d instead.  And here was I, thinking how great it is not to bother with the old printf format codes, using the %@ way instead.  I hate the primitive type/object distinction!</p>
<p>I then also found that I had created two superimposed Table Views (did I mention that I don&#8217;t really like Interface Builder after all?), so that my table got overwritten and looked all wrong.  Now I&#8217;m struggling with getting the table to start at the first entry, not the 35th (indexPath seems to start counting sections at 1, rather than 0), and all of a sudden my database won&#8217;t work.</p>
<p>Preparing a straightforward SQL statement suddenly fails.  I did not change that part of the code, the database file is still the same as it used to be before the error occurred, and I did tell XCode to do a full clean.  Still, the error remains.</p>
<p>Grmph.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/omlog.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/omlog.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/omlog.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/omlog.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/omlog.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/omlog.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/omlog.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/omlog.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/omlog.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/omlog.wordpress.com/100/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=omlog.wordpress.com&blog=2985839&post=100&subd=omlog&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://omlog.wordpress.com/2009/06/23/every-character-is-important/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b3e5e6b5ecd2707930a109a46c0cfafe?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ojmason</media:title>
		</media:content>
	</item>
		<item>
		<title>Tab Bar Errors</title>
		<link>http://omlog.wordpress.com/2009/06/22/tab-bar-errors/</link>
		<comments>http://omlog.wordpress.com/2009/06/22/tab-bar-errors/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 16:32:00 +0000</pubDate>
		<dc:creator>ojmason</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://omlog.wordpress.com/?p=97</guid>
		<description><![CDATA[DAY 9 and more frustration.  My ViewControllers didn&#8217;t seem to be called, and NSLog messages I put in didn&#8217;t appear on the console.  And the whole thing crashed without me knowing what was going on.
Having another look at my iPhone development book, I realised the first mistake: the TabBar Controller wasn&#8217;t aware of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=omlog.wordpress.com&blog=2985839&post=97&subd=omlog&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><strong>DAY 9</strong> and more frustration.  My ViewControllers didn&#8217;t seem to be called, and NSLog messages I put in didn&#8217;t appear on the console.  And the whole thing crashed without me knowing what was going on.</p>
<p>Having another look at my iPhone development book, I realised the first mistake: the TabBar Controller wasn&#8217;t aware of which controllers to call up for the various tabs, something you need to set up in Interface Builder.  Still don&#8217;t really like that way of doing things, as the fact you&#8217;ve done it (or not, as the case may be!) is not easily transparent.</p>
<p>After completing the tab bar attributes, the log messages suddenly turned up, which was good, and it also doesn&#8217;t crash.  Well, at least not where it used to crash.  Now it crashes in the loop where I read stuff out of the SQLITE database, and it crashes after the <em>second</em> iteration.  Wonder what the cause is.  Probably memory management.  Mixing Objective-C and plain C makes things a bit confusing.  And I don&#8217;t like that NSString is an object you need to allocate, but NSInteger is basically just an alias for int, so a primitive data type rather than an object.</p>
<p>Anyway, more bug hunting coming up.  It all feels terribly slow, but then I&#8217;m only spending a few hours every couple of weeks on it at the moment.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/omlog.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/omlog.wordpress.com/97/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/omlog.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/omlog.wordpress.com/97/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/omlog.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/omlog.wordpress.com/97/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/omlog.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/omlog.wordpress.com/97/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/omlog.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/omlog.wordpress.com/97/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=omlog.wordpress.com&blog=2985839&post=97&subd=omlog&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://omlog.wordpress.com/2009/06/22/tab-bar-errors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b3e5e6b5ecd2707930a109a46c0cfafe?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ojmason</media:title>
		</media:content>
	</item>
		<item>
		<title>Table Frustration</title>
		<link>http://omlog.wordpress.com/2009/05/31/table-frustration/</link>
		<comments>http://omlog.wordpress.com/2009/05/31/table-frustration/#comments</comments>
		<pubDate>Sun, 31 May 2009 22:50:31 +0000</pubDate>
		<dc:creator>ojmason</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://omlog.wordpress.com/?p=93</guid>
		<description><![CDATA[DAY 8 and after a long pause I have been able to spend a bit more time on my project.  And it was certainly frustrating, racking up the hours while trying to work out why it didn&#8217;t work.  One thing I need to get used to are IDEs; more than a decade of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=omlog.wordpress.com&blog=2985839&post=93&subd=omlog&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><strong>DAY 8</strong> and after a long pause I have been able to spend a bit more time on my project.  And it was certainly frustrating, racking up the hours while trying to work out why it didn&#8217;t work.  One thing I need to get used to are IDEs; more than a decade of simply editing code in vi and compiling it on the command-line leave you ill-prepared for working with XCode, nice though it may be.  Interface Builder is also a great tool, but it hides things from direct view or easy inspection, at least if you don&#8217;t know where to look.  And then something doesn&#8217;t work because you omitted a link from a View to its File Owner, or you set the base class of MainWindow.xib to a wrong class type.</p>
<p>After trying out some table code in the iPhone Development book I finally got a small demo going.  I&#8217;m now trying to create an indexed grouped table display backed by a sqlite database working.  But now it&#8217;s approaching midnight and I&#8217;m too tired to work out why it stopped working again&#8230;</p>
<p>However, despite all of today&#8217;s frustration, I&#8217;m getting more and more used to coding in Objective-C, which has to be a positive side-effect!</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/omlog.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/omlog.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/omlog.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/omlog.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/omlog.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/omlog.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/omlog.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/omlog.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/omlog.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/omlog.wordpress.com/93/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=omlog.wordpress.com&blog=2985839&post=93&subd=omlog&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://omlog.wordpress.com/2009/05/31/table-frustration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b3e5e6b5ecd2707930a109a46c0cfafe?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ojmason</media:title>
		</media:content>
	</item>
		<item>
		<title>Further Education</title>
		<link>http://omlog.wordpress.com/2009/05/11/further-education/</link>
		<comments>http://omlog.wordpress.com/2009/05/11/further-education/#comments</comments>
		<pubDate>Mon, 11 May 2009 21:20:40 +0000</pubDate>
		<dc:creator>ojmason</dc:creator>
				<category><![CDATA[iphone]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://omlog.wordpress.com/2009/05/11/further-education/</guid>
		<description><![CDATA[I&#8217;m too busy with marking and a paper I have to write to get stuck in again. On the way home today I had a thought about the database-backed table view it will include: something regarding sorting which I came across when working at the Cobuild project. More on that later. 
But I&#8217;m still using [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=omlog.wordpress.com&blog=2985839&post=92&subd=omlog&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I&#8217;m too busy with marking and a paper I have to write to get stuck in again. On the way home today I had a thought about the database-backed table view it will include: something regarding sorting which I came across when working at the Cobuild project. More on that later. </p>
<p>But I&#8217;m still using the time more or less productively by watching the lectures on iPhone programming from Stanford (available on iTunesU). Not too sure about the performance aspect, but it is great to be able to listen to those guys explaining the intricacies of Objective-C memory management. And I won&#8217;t complain, as it is freely available. Thanks for that, Stanford!</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/omlog.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/omlog.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/omlog.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/omlog.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/omlog.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/omlog.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/omlog.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/omlog.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/omlog.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/omlog.wordpress.com/92/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=omlog.wordpress.com&blog=2985839&post=92&subd=omlog&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://omlog.wordpress.com/2009/05/11/further-education/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b3e5e6b5ecd2707930a109a46c0cfafe?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ojmason</media:title>
		</media:content>
	</item>
	</channel>
</rss>