<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/"><id>tag:blogger.com,1999:blog-6618918424144400605</id><updated>2007-11-25T21:32:00.252-08:00</updated><title type="text">Andy's Laboratory</title><link rel="alternate" type="text/html" href="http://andykim.net/" /><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://andykim.net/atom.xml" /><author><name>Andy Kim</name></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>6</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><link rel="self" href="http://feeds.feedburner.com/AndysLaboratory" type="application/atom+xml" /><entry><id>tag:blogger.com,1999:blog-6618918424144400605.post-503289116412674904</id><published>2007-06-23T01:29:00.000-07:00</published><updated>2007-06-23T01:35:00.898-07:00</updated><title type="text">Closing Down</title><content type="html">Since I am now the sole owner of Potion Factory, I will be doing my blogging at the &lt;a href="http://www.potionfactory.com/blog"/&gt;company blog&lt;/a&gt;. If you are subscribed to this blog, please unsubscribe as this site will be going away eventually.</content><link rel="alternate" type="text/html" href="http://andykim.net/2007/06/closing-blog.html" title="Closing Down" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6618918424144400605&amp;postID=503289116412674904&amp;isPopup=true" title="0 Comments" /><link rel="replies" type="application/atom+xml" href="http://andykim.net/atom.xml" title="Post Comments" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6618918424144400605/posts/default/503289116412674904" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6618918424144400605/posts/default/503289116412674904" /><author><name>Andy Kim</name></author></entry><entry><id>tag:blogger.com,1999:blog-6618918424144400605.post-3793132029266654286</id><published>2007-01-07T02:23:00.000-08:00</published><updated>2007-01-07T12:07:33.658-08:00</updated><title type="text">My MWSF Prediction</title><content type="html">&lt;img style="display:block; margin:0px auto 10px; text-align:center" src="http://andykim.net/uploaded_images/frog-731220.png" border="0" alt="" /&gt;&lt;br /&gt;&lt;br /&gt;Just practicing with my new Wacom Intuos3 tablet.</content><link rel="alternate" type="text/html" href="http://andykim.net/2007/01/my-mwsf-prediction.html" title="My MWSF Prediction" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6618918424144400605&amp;postID=3793132029266654286&amp;isPopup=true" title="1 Comments" /><link rel="replies" type="application/atom+xml" href="http://andykim.net/atom.xml" title="Post Comments" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6618918424144400605/posts/default/3793132029266654286" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6618918424144400605/posts/default/3793132029266654286" /><author><name>Andy Kim</name></author></entry><entry><id>tag:blogger.com,1999:blog-6618918424144400605.post-1658486298534596714</id><published>2007-01-04T13:23:00.000-08:00</published><updated>2007-01-04T13:36:46.633-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="cool" /><category scheme="http://www.blogger.com/atom/ns#" term="application" /><title type="text">WriteRoom Drama</title><content type="html">I have never corresponded with Jesse Grosjean of Hogbay Software before, but I want to congratulate him on the release of WriteRoom 2.0. It looks like a fantastic application.&lt;br /&gt;&lt;br /&gt;What got me blogging about WriteRoom though is a post on Jesse's blog where he explains the new $25 pricetag of a previously free application in response to an angry comment on VersionTracker.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;But then I started reading comments on some popular download sites... ouch. The basic thesis is that WriteRoom is a great program, but I'm an evil person for charging $25 dollars for it. And once I'm evil a few other comments concerning Mori and Hog Bay Software in general are thrown in.&lt;br /&gt;&lt;br /&gt;I'm not sure that I can make those people happy, but here I'll at least try to explain myself and the pricing of WriteRoom.&lt;/blockquote&gt;&lt;br /&gt;&lt;a href="http://www.hogbaysoftware.com/node/2016"&gt;Link to Jesse's post, "The life and drama of a Mac shareware developer"&lt;/a&gt;</content><link rel="alternate" type="text/html" href="http://andykim.net/2007/01/writeroom-drama.html" title="WriteRoom Drama" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6618918424144400605&amp;postID=1658486298534596714&amp;isPopup=true" title="1 Comments" /><link rel="replies" type="application/atom+xml" href="http://andykim.net/atom.xml" title="Post Comments" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6618918424144400605/posts/default/1658486298534596714" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6618918424144400605/posts/default/1658486298534596714" /><author><name>Andy Kim</name></author></entry><entry><id>tag:blogger.com,1999:blog-6618918424144400605.post-4890965020661329074</id><published>2007-01-01T02:19:00.000-08:00</published><updated>2007-01-01T03:32:07.778-08:00</updated><title type="text">Xcode Feature Request</title><content type="html">I really want to use Xcode to edit Objective-C. I desperately want to. Xcode 3 comes closer to being a usable editor, but I really wish that Xcode had the following feature:&lt;br /&gt;&lt;br /&gt;&lt;embed src="http://andykim.net/files/2007/01/emacs-session.mov" href="http://andykim.net/files/2007/01/emacs-session.mov" target="myself" width="480" height="304" autoplay="false" controller="true" border="0" pluginspage="http://www.apple.com/quicktime/download/indext.html" type="video/quicktime"&gt;&lt;/embed&gt;&lt;br /&gt;&lt;br /&gt;I never liked navigating around the brackets in Objective-C, so this was something I hacked into Emacs pretty early on while adapting to Cocoa.&lt;br /&gt;&lt;br /&gt;On the topic of editors, there's a cool editor for Scheme called DivaScheme. It's heavily influenced by vi and it makes navigating through code a breeze. Much of what is cool in DivaScheme is possible because Scheme and Lisp's syntax is so minimal, but I don't see why the concept can't be applied to Obj-C as well. If you are planning to write Yet Another Text Editor, please do us all a favor and click the link below. The page has a short video tutorial.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.cs.brown.edu/research/plt/software/divascheme/"&gt;Link to DivaScheme&lt;/a&gt;</content><link rel="alternate" type="text/html" href="http://andykim.net/2007/01/xcode-feature-request.html" title="Xcode Feature Request" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6618918424144400605&amp;postID=4890965020661329074&amp;isPopup=true" title="7 Comments" /><link rel="replies" type="application/atom+xml" href="http://andykim.net/atom.xml" title="Post Comments" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6618918424144400605/posts/default/4890965020661329074" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6618918424144400605/posts/default/4890965020661329074" /><author><name>Andy Kim</name></author></entry><entry><id>tag:blogger.com,1999:blog-6618918424144400605.post-355556369694059989</id><published>2006-12-29T00:01:00.000-08:00</published><updated>2006-12-29T04:15:37.028-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="code" /><category scheme="http://www.blogger.com/atom/ns#" term="cocoa" /><title type="text">Syntactic Sugars</title><content type="html">I have a sweet tooth for syntactic sugar. I love things like mystring[-1] in Python. Just like real world sugar, too much syntactic sugar can ruin the health of a programmer, but in moderation, it's a wonderful thing.&lt;br /&gt;&lt;br /&gt;Naturally, I was overjoyed to learn that Objective-C 2.0 in Leopard will bring property accessors and foreach style loops. This is all good except that in order to take advantage of these 1999 technologies you have to target Leopard. While not a problem for people developing new applications, it's a huge tease for the rest of us.&lt;br /&gt;&lt;br /&gt;So what's a programmer to do? Well, at Potion Factory we actually have had accessors and foreach loops for a while now. The solution involves lots of macros and it's of course nothing like what you get with Obj-C 2.0, but it still saves us an enormous amount of typing.&lt;br /&gt;&lt;h3&gt;Foreach style loops&lt;/h3&gt;&lt;br /&gt;After having programmed in Python for a while, I found the following enumeration idiom in Objective-C to be rather painful, to put it mildly.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;NSEnumerator *e = [collection objectEnumerator];&lt;br /&gt;id obj;&lt;br /&gt;while (obj = [e nextObject]) {&lt;br /&gt;    // do stuff with obj&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;I can't believe it's not butter... or Java...&lt;br /&gt;&lt;br /&gt;Luckily I found the following foreach macro somewhere in the cocoa newsgroup.&lt;br /&gt;&lt;code&gt;#define foreach(element, collection) \&lt;br /&gt;    for (id _##element##_enumerator = [collection objectEnumerator], element; \&lt;br /&gt;         element = [_##element##_enumerator nextObject]; )&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;It simplifies the enumeration down to the following bit of code&lt;br /&gt;&lt;code&gt;foreach (obj, collection) {&lt;br /&gt;    // do stuff with obj&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;More than just taking out two lines of code, this drastically improves the readability., It also saves you from typing the same thing mindlessly over and over throughout the day.&lt;br /&gt;&lt;br /&gt;Later on I found out that the foreach macro has been discussed by &lt;a href="http://rentzsch.com/papers/improvingCocoaObjCEnumeration"&gt;Jonathan Rentzsch&lt;/a&gt;, &lt;a href="http://mjtsai.com/blog/2006/07/15/cocoa-foreach-macro/"&gt;Michael Tsai&lt;/a&gt;, and &lt;a href="http://wincent.com/a/knowledge-base/archives/2006/01/objectivec_enum.php"&gt;Wincent Colaiuta&lt;/a&gt;. Jonathan has a type-safe version where you specify the object type in the loop to get compiler warnings and Michael's implementation does IMP-caching to speed up calls to -nextObject.&lt;br /&gt;&lt;h3&gt;Accessors&lt;/h3&gt;&lt;br /&gt;&lt;code&gt;// For interface&lt;br /&gt;&lt;br /&gt;#define GETTER_H(type, attr, capattr) \&lt;br /&gt;    - (type)attr;&lt;br /&gt;&lt;br /&gt;#define SETTER_H(type, attr, capattr) \&lt;br /&gt;    - (void)set##capattr:(type)value;&lt;br /&gt;&lt;br /&gt;#define ACCESSORS_H(type, attr, capattr) \&lt;br /&gt;    GETTER_H(type, attr, capattr) \&lt;br /&gt;    SETTER_H(type, attr, capattr)&lt;br /&gt;&lt;br /&gt;// For implementation&lt;br /&gt;&lt;br /&gt;#define MYASSIGN(old, new) \&lt;br /&gt;    if (old != new) { \&lt;br /&gt;        [new retain]; \&lt;br /&gt;        [old release]; \&lt;br /&gt;        old = new; }&lt;br /&gt;&lt;br /&gt;#define GETTER(type, attr, capattr) \&lt;br /&gt;    - (type)attr { return m##capattr; }&lt;br /&gt;&lt;br /&gt;#define SETTER(type, attr, capattr) \&lt;br /&gt;    - (void)set##capattr:(type)value { MYASSIGN(m##capattr,value); }&lt;br /&gt;&lt;br /&gt;#define ACCESSORS(type, attr, capattr) \&lt;br /&gt;    GETTER(type, attr, capattr) \&lt;br /&gt;    SETTER(type, attr, capattr)&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;The macros above allows us to define and implement our accessors the following way:&lt;br /&gt;&lt;code&gt;@interface Person : NSObject {&lt;br /&gt;    NSString *mName;&lt;br /&gt;}&lt;br /&gt;ACCESSORS_H(NSString*, name, Name);&lt;br /&gt;@end&lt;br /&gt;&lt;br /&gt;@implementation Person&lt;br /&gt;ACCESSORS(NSString*, name, Name);&lt;br /&gt;@end&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;We use various flavors of the above macro and it allows us to develop our applications much faster. Again, it improves readability and eliminates much typing. The (f)ugly part is having to type the variable name in both lowercase and capitalized forms. If you know how that can be avoided, please let me know.&lt;br /&gt;&lt;br /&gt;The time savings become quite significant when you apply the idea to Core Data's managed object subclasses.&lt;br /&gt;&lt;br /&gt;&lt;a href="/files/2006-12/ManagedObjectAccessors.h"&gt;ManagedObjectAccessors.h&lt;/a&gt;</content><link rel="alternate" type="text/html" href="http://andykim.net/2006/12/syntactic-sugars.html" title="Syntactic Sugars" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6618918424144400605&amp;postID=355556369694059989&amp;isPopup=true" title="9 Comments" /><link rel="replies" type="application/atom+xml" href="http://andykim.net/atom.xml" title="Post Comments" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6618918424144400605/posts/default/355556369694059989" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6618918424144400605/posts/default/355556369694059989" /><author><name>Andy Kim</name></author></entry><entry><id>tag:blogger.com,1999:blog-6618918424144400605.post-3784158150759769855</id><published>2006-12-26T04:00:00.000-08:00</published><updated>2006-12-26T04:37:05.701-08:00</updated><title type="text">Hello, World!</title><content type="html">Ah, it's the end of the year. It's time for the festivities, wonderful gifts, getting drunk, and making resolutions (while drunk?) that usually last a month at best. My new year's resolution this year is becoming the most famous Andy Kim in the world. How the heck do you measure famousness? With Google pagerank of course. There are a lot of Andy Kims in the world, with 99.999% of them being of Korean descent, but &lt;a href="http://www.google.com/search?rls=en&amp;q=andy+kim"&gt;right now&lt;/a&gt; the top position is held by the Canadian singer and song-writer famous for the 70's hits such as &lt;a href="http://www.amazon.com/Baby-Love-You-Greatest-Hits/dp/B000006X6P"&gt;Baby I Love You&lt;/a&gt; and &lt;a href="http://www.youtube.com/watch?v=Ott0EacbphM"&gt;Sugar, Sugar&lt;/a&gt;. With this blog I intend to beat the singer to become the most famous me there is. I figure that if this doesn't work, I'll start uploading videos to YouTube as lonelykim15, but I am hoping that it doesn't have to come to that.&lt;br /&gt;&lt;br /&gt;By the way, I do realize that this is juvenile and narcissistic, but before you pass judgement, just take a look at &lt;a href="http://ec2.images-amazon.com/images/P/B000006X6P.01._SS500_SCLZZZZZZZ_V1115830280_.jpg"&gt;this photo&lt;/a&gt; and tell me that you would want that to be the first hit on your name search. In this day and age where people—say, a blind-date, for example—google your name, these things become important.&lt;br /&gt;&lt;br /&gt;All jokes aside, here I will rant about stuff that interest me—such as, the Mac, programming on the Mac (with Cocoa mostly), running a Mac ISV called Potion Factory, stuff relating to design, and maybe even boring personal stuff from time to time.&lt;br /&gt;&lt;br /&gt;Welcome to my blog and I hope to see you around.</content><link rel="alternate" type="text/html" href="http://andykim.net/2006/12/hello-world.html" title="Hello, World!" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6618918424144400605&amp;postID=3784158150759769855&amp;isPopup=true" title="7 Comments" /><link rel="replies" type="application/atom+xml" href="http://andykim.net/atom.xml" title="Post Comments" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6618918424144400605/posts/default/3784158150759769855" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6618918424144400605/posts/default/3784158150759769855" /><author><name>Andy Kim</name></author></entry></feed>
