<?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/"
	>

<channel>
	<title>GeekyGoodness</title>
	<atom:link href="http://www.geekygoodness.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.geekygoodness.com</link>
	<description>Software Developer</description>
	<lastBuildDate>Mon, 01 Mar 2010 09:00:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>The Overlaying NSOutlineView</title>
		<link>http://www.geekygoodness.com/2010/02/28/the-overlaying-nsoutlineview/</link>
		<comments>http://www.geekygoodness.com/2010/02/28/the-overlaying-nsoutlineview/#comments</comments>
		<pubDate>Sat, 27 Feb 2010 23:28:01 +0000</pubDate>
		<dc:creator>Curtis Hard</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.geekygoodness.com/?p=124</guid>
		<description><![CDATA[Hello Folks! I thought I would do a quick post on how I achieved the &#8220;overlaying&#8221; NSOutlineView effect within Caffeinated. Im not going to provide source, meerly the thought process behind it. So here it goes. Its made up of 2 NSOutlineViews, one embedded within the others NSScrollView. The main NSOutlineView has a custom cell [...]]]></description>
			<content:encoded><![CDATA[<p>Hello Folks!</p>
<p>I thought I would do a quick post on how I achieved the &#8220;overlaying&#8221; NSOutlineView effect within Caffeinated.</p>
<p>Im not going to provide source, meerly the thought process behind it. So here it goes.</p>
<p>Its made up of 2 NSOutlineViews, one embedded within the others NSScrollView. The main NSOutlineView has a custom cell at the top of it which is the same height as the overlaying NSOutlineView. Due to the fact the overlaying NSOutlineView is wrapped within a NSScrollView, you must subclass its scrollview to forward the scrolling events on to its superview &#8211; superview, so 2 levels up the display list. Another problem will occur when the main NSScrollView redisplays the main NSOutlineView, this will cause the cells within the main NSOutlineView to draw over the top of the overlaying NSOutlineView. To get around this problem we observe the main NSScrollView for its scrolling notification and redraw the overlaying NSOutlineView when it has been posted.</p>
<p>Another thing you will notice is the shadow and the indent lines. This is meerly produced by subclassing the NSOutlineView class and overriding its drawRect methods and drawing the indent lines. How the shadow works is just by drawing an image below the overlaying NSOutlineView, with custom methods in the delegate, you can easily turn the shadow on and off.</p>
<p>Next part is overriding the keyboard events within the NSOutlineView, so that both of the views act as one when reaching the first and last item within them and selecting the appropriate view. Its actually pretty simple once you get your head around the concept. It does require you to type a fair bit of code, but its worth it ;)</p>
<p>Hope this helps anyone.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.geekygoodness.com/2010/02/28/the-overlaying-nsoutlineview/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quick glance at NSOperationQueue</title>
		<link>http://www.geekygoodness.com/2009/11/30/quick-glance-at-nsoperationqueue/</link>
		<comments>http://www.geekygoodness.com/2009/11/30/quick-glance-at-nsoperationqueue/#comments</comments>
		<pubDate>Mon, 30 Nov 2009 08:59:47 +0000</pubDate>
		<dc:creator>Curtis Hard</dc:creator>
				<category><![CDATA[COCOA]]></category>

		<guid isPermaLink="false">http://www.geekygoodness.com/?p=120</guid>
		<description><![CDATA[I was recently having a quick play with threading in COCOA ( because I needed to run some code on another thread ) and stumbled across NSOperationQueue within the docs. Basically, NSOperationQueue handles NSOperation&#8217;s, you give it an NSOperation, it will queue it, and run it when it gets to that part in the queue, [...]]]></description>
			<content:encoded><![CDATA[<p>I was recently having a quick play with threading in COCOA ( because I needed to run some code on another thread ) and stumbled across NSOperationQueue within the docs. Basically, NSOperationQueue handles NSOperation&#8217;s, you give it an NSOperation, it will queue it, and run it when it gets to that part in the queue, but the cool thing is &#8230; it runs the NSOperation on another thread!</p>
<p>Its really simple to use, to run your own code / class, you ust subclass NSOperation and have a method called main which doesn&#8217;t return anything, so &#8230; &#8211; (void)main {}. main will get invoked when the item gets called, once all your code has done what it was set out to do, you simple have to perform a selector on the main thread and do what ever you like.</p>
<p>All that said and done, its pretty god damn awesome!, if you haven&#8217;t had a look at it yet, its worth a go :D.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.geekygoodness.com/2009/11/30/quick-glance-at-nsoperationqueue/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IE + Flash uploading = Road to fail</title>
		<link>http://www.geekygoodness.com/2009/10/29/ie-flash-uploading-road-to-fail/</link>
		<comments>http://www.geekygoodness.com/2009/10/29/ie-flash-uploading-road-to-fail/#comments</comments>
		<pubDate>Thu, 29 Oct 2009 20:43:07 +0000</pubDate>
		<dc:creator>Curtis Hard</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.geekygoodness.com/?p=109</guid>
		<description><![CDATA[Today I had come across a weird problem / bug with good old Internet Explorer. I have a custom file uploader created with ActionScript and works fine in pretty much every browser, even IE...well, if you only want to use it once....]]></description>
			<content:encoded><![CDATA[<p>Today I had come across a weird problem / bug with good old Internet Explorer. I have a custom file uploader created with ActionScript and works fine in pretty much every browser, even IE&#8230;well, if you only want to use it once.</p>
<p>The problem is, Internet Explorer ( bless its cotton socks ) doesn&#8217;t like you loading the same swf file into the document dynamically over and over again. It will meerly use a cached file, so whatever you inject into the Flash movie when its loaded is stored and IE will constantly use this movie until you close the browser.</p>
<p>The solution? Very simple&#8230;meery wack a timestamp on the end of the file you wish to include&#8230;like this :</p>
<pre>
'mymovie.swf?time=' + new Date().getTime();
</pre>
<p>Thus Internet Explorer will think its a completely new file and load that bad boy in again!</p>
<p>Once again IE has made me spend endless hours on pointless bulls**t.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.geekygoodness.com/2009/10/29/ie-flash-uploading-road-to-fail/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A simple COCOA Asynchronous image loader class to use in your iPhone app.</title>
		<link>http://www.geekygoodness.com/2009/09/13/a-simple-cocoa-asynchronous-image-loader-class-to-use-in-your-iphone-app/</link>
		<comments>http://www.geekygoodness.com/2009/09/13/a-simple-cocoa-asynchronous-image-loader-class-to-use-in-your-iphone-app/#comments</comments>
		<pubDate>Sun, 13 Sep 2009 21:18:46 +0000</pubDate>
		<dc:creator>Curtis Hard</dc:creator>
				<category><![CDATA[COCOA]]></category>

		<guid isPermaLink="false">http://www.geekygoodness.com/?p=96</guid>
		<description><![CDATA[This isnt a tutorial, this is just some source code that you might find useful. This class will load images in the background so it wont lock your UI up!]]></description>
			<content:encoded><![CDATA[<p>This isnt a tutorial, this is just some source code that you might find useful. This class will load images in the background so it wont lock your UI up!</p>
<p>Heres the header file :</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
</pre></td><td class="code"><pre class="c" style="font-family:monospace;">@interface GGImageLoader <span style="color: #339933;">:</span> NSObject <span style="color: #009900;">&#123;</span>
&nbsp;
	NSURLConnection <span style="color: #339933;">*</span> connection<span style="color: #339933;">;</span>
&nbsp;
	NSURL <span style="color: #339933;">*</span> url<span style="color: #339933;">;</span>
&nbsp;
	NSMutableData <span style="color: #339933;">*</span> mutData<span style="color: #339933;">;</span>
&nbsp;
	UIImage <span style="color: #339933;">*</span> image<span style="color: #339933;">;</span>
&nbsp;
	id delegate<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
@property <span style="color: #009900;">&#40;</span> nonatomic<span style="color: #339933;">,</span> retain <span style="color: #009900;">&#41;</span> UIImage <span style="color: #339933;">*</span> image<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #339933;">-</span> <span style="color: #009900;">&#40;</span>id<span style="color: #009900;">&#41;</span>initWithURL<span style="color: #339933;">:</span><span style="color: #009900;">&#40;</span>NSURL <span style="color: #339933;">*</span><span style="color: #009900;">&#41;</span>aURL<span style="color: #339933;">;</span>
<span style="color: #339933;">-</span> <span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span>setDelegate<span style="color: #339933;">:</span><span style="color: #009900;">&#40;</span>id<span style="color: #009900;">&#41;</span>anObject<span style="color: #339933;">;</span>
<span style="color: #339933;">-</span> <span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span>load<span style="color: #339933;">;</span>
&nbsp;
@end
&nbsp;
@protocol GGImageLoaderProtocol
&nbsp;
@required
<span style="color: #339933;">-</span> <span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span>imageLoader<span style="color: #339933;">:</span><span style="color: #009900;">&#40;</span>GGImageLoader <span style="color: #339933;">*</span><span style="color: #009900;">&#41;</span>loader
	   didLoadImage<span style="color: #339933;">:</span><span style="color: #009900;">&#40;</span>UIImage <span style="color: #339933;">*</span><span style="color: #009900;">&#41;</span>anImage<span style="color: #339933;">;</span>
&nbsp;
@optional
<span style="color: #339933;">-</span> <span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span>imageLoader<span style="color: #339933;">:</span><span style="color: #009900;">&#40;</span>GGImageLoader <span style="color: #339933;">*</span><span style="color: #009900;">&#41;</span>loader
	didReceiveError<span style="color: #339933;">:</span><span style="color: #009900;">&#40;</span>NSError <span style="color: #339933;">*</span><span style="color: #009900;">&#41;</span>anError<span style="color: #339933;">;</span>
&nbsp;
@end</pre></td></tr></table></div>

<p>and heres the main file :</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
</pre></td><td class="code"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">#import &quot;GGImageLoader.h&quot;</span>
&nbsp;
&nbsp;
@implementation GGImageLoader
&nbsp;
@synthesize image<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #339933;">-</span> <span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span>dealloc
<span style="color: #009900;">&#123;</span>
	<span style="color: #009900;">&#91;</span>super dealloc<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#91;</span>url release<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#91;</span>connection release<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#91;</span>mutData release<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#91;</span>image release<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #339933;">-</span> <span style="color: #009900;">&#40;</span>id<span style="color: #009900;">&#41;</span>initWithURL<span style="color: #339933;">:</span><span style="color: #009900;">&#40;</span>NSURL <span style="color: #339933;">*</span><span style="color: #009900;">&#41;</span>aURL
<span style="color: #009900;">&#123;</span>
	url <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span>aURL retain<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">return</span> self<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #339933;">-</span> <span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span>setDelegate<span style="color: #339933;">:</span><span style="color: #009900;">&#40;</span>id<span style="color: #009900;">&#41;</span>anObject
<span style="color: #009900;">&#123;</span>
	delegate <span style="color: #339933;">=</span> anObject<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #339933;">-</span> <span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span>load
<span style="color: #009900;">&#123;</span>
	<span style="color: #666666; font-style: italic;">// SHOW NETWORK INDICATOR</span>
&nbsp;
	<span style="color: #009900;">&#91;</span>UIApplication sharedApplication<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">networkActivityIndicatorVisible</span> <span style="color: #339933;">=</span> YES<span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// SET UP THE REQUEST</span>
&nbsp;
	NSURLRequest <span style="color: #339933;">*</span> request <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#91;</span>NSURLRequest alloc<span style="color: #009900;">&#93;</span> initWithURL<span style="color: #339933;">:</span>url<span style="color: #009900;">&#93;</span> autorelease<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// SET UP THE CONNECTION</span>
&nbsp;
	connection <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#91;</span>NSURLConnection alloc<span style="color: #009900;">&#93;</span> initWithRequest<span style="color: #339933;">:</span>request
												 delegate<span style="color: #339933;">:</span>self<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// NEW MUT DATA</span>
&nbsp;
	mutData <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#91;</span>NSMutableData new<span style="color: #009900;">&#93;</span> retain<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #339933;">-</span> <span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span>connection<span style="color: #339933;">:</span><span style="color: #009900;">&#40;</span>NSURLConnection <span style="color: #339933;">*</span><span style="color: #009900;">&#41;</span>connection
  didFailWithError<span style="color: #339933;">:</span><span style="color: #009900;">&#40;</span>NSError <span style="color: #339933;">*</span><span style="color: #009900;">&#41;</span>error
<span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#91;</span>delegate respondsToSelector<span style="color: #339933;">:</span>@selector<span style="color: #009900;">&#40;</span>imageLoader<span style="color: #339933;">:</span>didReceieveError<span style="color: #339933;">:</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #009900;">&#91;</span>delegate imageLoader<span style="color: #339933;">:</span>self
			  didReceiveError<span style="color: #339933;">:</span>error<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #339933;">-</span> <span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span>connection<span style="color: #339933;">:</span><span style="color: #009900;">&#40;</span>NSURLConnection <span style="color: #339933;">*</span><span style="color: #009900;">&#41;</span>connection
	didReceiveData<span style="color: #339933;">:</span><span style="color: #009900;">&#40;</span>NSData <span style="color: #339933;">*</span><span style="color: #009900;">&#41;</span>data
<span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// APPEND THE DATA</span>
&nbsp;
	<span style="color: #009900;">&#91;</span>mutData appendData<span style="color: #339933;">:</span>data<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #339933;">-</span> <span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span>connectionDidFinishLoading<span style="color: #339933;">:</span><span style="color: #009900;">&#40;</span>NSURLConnection <span style="color: #339933;">*</span><span style="color: #009900;">&#41;</span>aConnection
<span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// ONCE LOADED HIDE NETWORK INDICATOR</span>
&nbsp;
	<span style="color: #009900;">&#91;</span>UIApplication sharedApplication<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">networkActivityIndicatorVisible</span> <span style="color: #339933;">=</span> NO<span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// RELEASE THE CONNECTION</span>
&nbsp;
	<span style="color: #009900;">&#91;</span>connection release<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// CREATE NEW UIIMAGE FROM THE DATA</span>
&nbsp;
	image <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#91;</span>UIImage alloc<span style="color: #009900;">&#93;</span> initWithData<span style="color: #339933;">:</span>mutData<span style="color: #009900;">&#93;</span> retain<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#91;</span>delegate respondsToSelector<span style="color: #339933;">:</span>@selector<span style="color: #009900;">&#40;</span>imageLoader<span style="color: #339933;">:</span>didLoadImage<span style="color: #339933;">:</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #009900;">&#91;</span>delegate imageLoader<span style="color: #339933;">:</span>self
				 didLoadImage<span style="color: #339933;">:</span>image<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
@end</pre></td></tr></table></div>

<p>Its pretty self explanatory, meerly do the following to get it to work..</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="c" style="font-family:monospace;">GGImageLoader <span style="color: #339933;">*</span> imageLoader <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#91;</span>GGImageLoader alloc<span style="color: #009900;">&#93;</span> initWithURL<span style="color: #339933;">:</span><span style="color: #009900;">&#91;</span>NSURL URLWithString<span style="color: #339933;">:</span>@<span style="color: #ff0000;">&quot;myimageurlhere&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span> retain<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#91;</span>imageLoader setDelegate<span style="color: #339933;">:</span>self<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#91;</span>imageLoader load<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>The class also has delegate methods and a protocol to follow, so we know when the image has loaded, you can use the GGImageLoaderProtocol in your header file if you like.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">-</span> <span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span>imageLoader<span style="color: #339933;">:</span><span style="color: #009900;">&#40;</span>GGImageLoader <span style="color: #339933;">*</span><span style="color: #009900;">&#41;</span>imageLoader didReceieveError<span style="color: #339933;">:</span><span style="color: #009900;">&#40;</span>NSError <span style="color: #339933;">*</span><span style="color: #009900;">&#41;</span>anError
<span style="color: #009900;">&#123;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #339933;">-</span> <span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span>imageLoader<span style="color: #339933;">:</span><span style="color: #009900;">&#40;</span>GGImageLoader <span style="color: #339933;">*</span><span style="color: #009900;">&#41;</span>imageLoader didLoadImage<span style="color: #339933;">:</span><span style="color: #009900;">&#40;</span>UIImage <span style="color: #339933;">*</span><span style="color: #009900;">&#41;</span>anImage
<span style="color: #009900;">&#123;</span>
	<span style="color: #666666; font-style: italic;">// BE SURE TO RELEASE THE IMAGE LOADER</span>
	<span style="color: #009900;">&#91;</span>imageLoader release<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>and thats about it, hope its helps some people out!</p>
<p>If ive made a mistake anywhere in this please say, it was a rush post!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.geekygoodness.com/2009/09/13/a-simple-cocoa-asynchronous-image-loader-class-to-use-in-your-iphone-app/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Add your Ember images to your site!</title>
		<link>http://www.geekygoodness.com/2009/08/21/add-your-ember-images-to-your-site/</link>
		<comments>http://www.geekygoodness.com/2009/08/21/add-your-ember-images-to-your-site/#comments</comments>
		<pubDate>Fri, 21 Aug 2009 10:11:04 +0000</pubDate>
		<dc:creator>Curtis Hard</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.geekygoodness.com/?p=85</guid>
		<description><![CDATA[Simple tutorial / code on how I got my Ember feed on the right. This script is written in PHP!]]></description>
			<content:encoded><![CDATA[<p>This is a very quick post of how I added my Ember feed on the right.</p>
<h2>1. The function</h2>
<p>Simply use this function I created :</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000000; font-weight: bold;">function</span> ember_thumbs<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$options</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</span> <span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;"># ARE THERE OPTIONS?
</span>	
	<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><span style="color: #000088;">$options</span> <span style="color: #009900;">&#41;</span>
		<span style="color: #b1b100;">return</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000088;">$feed</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'http://emberapp.com/'</span><span style="color: #339933;">.</span><span style="color: #990000;">urlencode</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$options</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'username'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'/images.rss'</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;"># CREATE NEW DOM DOCUMENT FOR EASE OF PARSING THE FEED
</span>	
	<span style="color: #000088;">$dom</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> DOMDocument<span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;"># LOAD THE FEED
</span>	
	<span style="color: #000088;">$dom</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">loadXML</span><span style="color: #009900;">&#40;</span> <span style="color: #990000;">file_get_contents</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$feed</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;"># GRAB THE ITEMS FROM THE FEED
</span>	
	<span style="color: #000088;">$images</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$dom</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getElementsByTagName</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'item'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000088;">$imgs</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;"># LOOP THROUGH EACH OF THE ITEMS
</span>	
	<span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$images</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$image</span> <span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>	
&nbsp;
		<span style="color: #666666; font-style: italic;"># TEMP ARRAY
</span>		
		<span style="color: #000088;">$t</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;"># LOOP THROUGH EACH CHILD NODE
</span>		
		<span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$image</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">childNodes</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$child</span> <span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
&nbsp;
			<span style="color: #666666; font-style: italic;"># IF THE CHILD HAS ATTRIBUTES, SUCH AS THE media:thumbnail TAG
</span>		
			<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$child</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">hasAttributes</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> 
			<span style="color: #009900;">&#123;</span>
				<span style="color: #000088;">$t</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$child</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">nodeName</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #000088;">$t</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$child</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">nodeName</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'nodeValue'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$child</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">nodeValue</span><span style="color: #339933;">;</span>
				<span style="color: #000088;">$attributes</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$child</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">attributes</span><span style="color: #339933;">;</span>
				<span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$attributes</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$at</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$att</span> <span style="color: #009900;">&#41;</span>
					<span style="color: #000088;">$t</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$child</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">nodeName</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$at</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$att</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">nodeValue</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span>
				<span style="color: #000088;">$t</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$child</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">nodeName</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$child</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">nodeValue</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;"># PUSH THE TEMP ARRAY INTO THE OVERALL ARRAY
</span>		
		<span style="color: #990000;">array_push</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$imgs</span><span style="color: #339933;">,</span> <span style="color: #000088;">$t</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;"># CONSTRUCT A STRING
</span>	
	<span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$imgs</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$image</span> <span style="color: #009900;">&#41;</span>
		<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">++</span> <span style="color: #339933;">&lt;</span> <span style="color: #000088;">$options</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'limit'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span>
			<span style="color: #000088;">$string</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'&lt;a class=&quot;ember_image&quot; href=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$image</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'link'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; title=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$image</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'title'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot;&gt;&lt;img src=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$image</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'media:thumbnail'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'url'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; width=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$options</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'size'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; height=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$options</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'size'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; /&gt;&lt;/a&gt;'</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;"># CLEAR FROM MEMORY
</span>	
	<span style="color: #990000;">unset</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$temp</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;"># RETURN THE STRING
</span>	
	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$string</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<h2>2. Using the function</h2>
<p>To use the function, simply parse in an array of options, which are :</p>
<ul>
<li>username</li>
<li>limit</li>
<li>size</li>
</ul>
<p>For example :</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> 
	<span style="color: #b1b100;">echo</span> ember_thumbs<span style="color: #009900;">&#40;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
		<span style="color: #0000ff;">'username'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'curthard89'</span><span style="color: #339933;">,</span>
		<span style="color: #0000ff;">'limit'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">6</span><span style="color: #339933;">,</span>
		<span style="color: #0000ff;">'size'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">92</span>
	<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Username being your username, limit being how many thumbs you want to display and size is the width and height of the image, once thats done, style till your heart is content.</p>
<p>If you have any questions or mods or anything be sure to leave a comment!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.geekygoodness.com/2009/08/21/add-your-ember-images-to-your-site/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>I am alive</title>
		<link>http://www.geekygoodness.com/2009/08/20/a-blog-post/</link>
		<comments>http://www.geekygoodness.com/2009/08/20/a-blog-post/#comments</comments>
		<pubDate>Thu, 20 Aug 2009 10:56:45 +0000</pubDate>
		<dc:creator>Curtis Hard</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.geekygoodness.com/?p=73</guid>
		<description><![CDATA[Hola! Its been a hell of along time since I posted anything on this blog. I wanted to post something a few days back and really hated the look and feel of the site&#8230;so I totally went and did it, I totally scrapped the other one and thus this new site was born. Although it [...]]]></description>
			<content:encoded><![CDATA[<p>Hola!</p>
<p>Its been a hell of along time since I posted anything on this blog. I wanted to post something a few days back and really hated the look and feel of the site&#8230;so I totally went and did it, I totally scrapped the other one and thus this new site was born. Although it says development blog at the top, this site will consist of geeky tutorials aswell, from the depths of the languages such as COCOA, ActionScript, JavaScript, PHP and anything else that seems to crop into my head. I plan on putting a tutorial on this site every week, or really anything thats rather geeky that I stumble across or have the urge to tell people about.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.geekygoodness.com/2009/08/20/a-blog-post/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
