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

<channel>
	<title>codza</title>
	<atom:link href="http://www.codza.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.codza.com</link>
	<description>non-denominational computing</description>
	<pubDate>Mon, 22 Mar 2010 14:30:26 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>extracting frames from movies on iPhone</title>
		<link>http://www.codza.com/extracting-frames-from-movies-on-iphone</link>
		<comments>http://www.codza.com/extracting-frames-from-movies-on-iphone#comments</comments>
		<pubDate>Wed, 10 Feb 2010 13:32:43 +0000</pubDate>
		<dc:creator>lajos</dc:creator>
		
		<category><![CDATA[apple]]></category>

		<category><![CDATA[mac]]></category>

		<category><![CDATA[extract]]></category>

		<category><![CDATA[ffmpeg]]></category>

		<category><![CDATA[frames]]></category>

		<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://www.codza.com/?p=343</guid>
		<description><![CDATA[The iPhone SDK provides a high level movie player, but so far there is no way to decode movies or extract frames. In this post I will show you how to do that using FFmpeg.
First, thanks to the FFmpeg project, Martin Böhme for his tutorial on using libavformat and libavcodec and David Conrad for the [...]]]></description>
			<content:encoded><![CDATA[<p>The iPhone SDK provides a high level movie player, but so far there is no way to decode movies or extract frames. In this post I will show you how to do that using <a href="http://ffmpeg.org/">FFmpeg</a>.</p>
<p><span id="more-343"></span>First, thanks to the <a href="http://ffmpeg.org/">FFmpeg project</a>, Martin Böhme for his tutorial on <a href="http://www.inb.uni-luebeck.de/~boehme/using_libavcodec.html">using libavformat and libavcodec</a> and David Conrad for the <a href="http://github.com/yuvi/gas-preprocessor">gas-preprocessor</a> project that allows us to compile FFmpeg for the iPhone.</p>
<p>Before you link the FFmpeg libraries to your project, make sure that you understand <a href="http://ffmpeg.org/legal.html">FFmpeg&#8217;s licensing</a>. My project uses the LGPL version of FFmpeg, which means that I have to make FFmpeg&#8217;s source code available (included in the project).</p>
<p>Before you create a commercial project that decodes H264 video, make sure that you get a license from <a href="http://www.mpegla.com/main/default.aspx">MPEG LA</a>.</p>
<p>The source code is posted on github: <a href="http://github.com/lajos/iFrameExtractor">git://github.com/lajos/iFrameExtractor.git</a>.</p>
<p>To compile and run the project on your iPhone:</p>
<ol>
<li>open Terminal</li>
<li>clone the repository: <strong>git clone git://github.com/lajos/iFrameExtractor.git</strong></li>
<li>go to the ffmpeg folder in the project: <strong>cd iFrameExtractor/ffmpeg</strong></li>
<li>build the ffmpeg libraries: <strong>./build_universal</strong></li>
<li>open the xcode project and run it on your iPhone device</li>
</ol>
<p>The <strong>build_universal</strong> shell script creates libraries that work on both armv6 and armv7 processors. If you need libraries for pre-3Gs devices (iPhone 2g, iPhone3G, iPod Touch), use the <strong>build_armv6</strong> script. For iPhone 3Gs only libraries, use <strong>build_armv7</strong>.</p>
<p><strong>iFrameExtractorAppDelegate</strong> creates an instance of <strong>VideoFrameExtractor</strong> (the class that grabs images from the video). When you press the <strong>play</strong> button, <strong>iFrameExtractorAppDelegate</strong> sets up a loop and displays all the images from the video until it reaches the end of the movie.</p>
<p>The <strong>VideoFrameExtractor </strong>class is based on Martin Böhme&#8217;s tutorial, upgraded to use swscale. Initialize this class with the full path of the movie:</p>
<pre>VideoFrameExtractor *video = [[VideoFrameExtractor alloc]
               initWithVideo:@"/full/path/to/movie.mov"];</pre>
<p>By default, the output size will match the movie&#8217;s size. You can set outputWidth and outputHeight to change the dimensions:</p>
<pre>video.outputWidth = 426;
video.outputHeight = 320;</pre>
<p>Use <strong>stepFrame </strong>to grab the next frame. This method returns <strong>false</strong> if there are no more frames (reached the end of video):</p>
<pre>BOOL result = [video stepFrame];</pre>
<p>The processed frame can be accessed as a <strong>UIImage</strong> on the <strong>currentImage</strong> property:</p>
<pre>UIImage *myImage = video.currentImage;</pre>
<p>You can seek to a specific time (in seconds) using the <strong>seekTime:</strong> method:</p>
<pre>[video seekTime:1.0];</pre>
<p>The movie&#8217;s length can be queried by checking the <strong>duration</strong> property:</p>
<pre>NSLog(@"video duration: %f",video.duration);</pre>
<p>This should get you started with extracting frames from iPhone movies <img src='http://www.codza.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> If you find any problems, please submit a patch.</p>
<p>Known issues:</p>
<ul>
<li>Images are always decoded as landscape.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.codza.com/extracting-frames-from-movies-on-iphone/feed</wfw:commentRss>
		</item>
		<item>
		<title>change __MyCompanyName__ in xcode templates</title>
		<link>http://www.codza.com/change-mycompanyname-in-xcode-templates</link>
		<comments>http://www.codza.com/change-mycompanyname-in-xcode-templates#comments</comments>
		<pubDate>Tue, 05 Jan 2010 00:24:40 +0000</pubDate>
		<dc:creator>lajos</dc:creator>
		
		<category><![CDATA[apple]]></category>

		<category><![CDATA[vista64]]></category>

		<category><![CDATA[fix]]></category>

		<category><![CDATA[template]]></category>

		<category><![CDATA[xcode]]></category>

		<category><![CDATA[__MyCompanyName__]]></category>

		<guid isPermaLink="false">http://www.codza.com/?p=336</guid>
		<description><![CDATA[For some strange reason there is no way to specify a company name in XCode.
Most source code templates include __MyCompanyName__ in the comments. To change it, open terminal and type this command replacing __MyCompanyName__ with whatever you want:

defaults write com.apple.Xcode PBXCustomTemplateMacroDefinitions -dict ORGANIZATIONNAME "__MyCompanyName__"
For example:

Restart XCode. New files will be created with the company name [...]]]></description>
			<content:encoded><![CDATA[<p>For some strange reason there is no way to specify a company name in XCode.</p>
<p>Most source code templates include __MyCompanyName__ in the comments. To change it, open terminal and type this command replacing <strong>__MyCompanyName__</strong> with whatever you want:</p>
<p><span id="more-336"></span></p>
<pre>defaults write com.apple.Xcode PBXCustomTemplateMacroDefinitions -dict ORGANIZATIONNAME "__MyCompanyName__"</pre>
<p>For example:</p>
<p><a href="http://www.codza.com/wp-content/uploads/2010/01/changemycompany.png"><img class="alignnone size-medium wp-image-337" title="changemycompany" src="http://www.codza.com/wp-content/uploads/2010/01/changemycompany-300x41.png" alt="changemycompany" width="300" height="41" /></a></p>
<p>Restart XCode. New files will be created with the company name you specified.</p>
<p>[rant]</p>
<p>Not sure why you can&#8217;t specify this from XCode, but at least there is a way to change it. It would be nice for Apple to fix this, but I&#8217;d rather them work on doing away with the moronic single menu bar for all applications, adding a feature to XCode to create text macros, fixing Spaces so my application windows would open on the designated Space, removing the animation from switching between Spaces, &#8230; gosh I should start a list for them.</p>
<p>[/rant]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codza.com/change-mycompanyname-in-xcode-templates/feed</wfw:commentRss>
		</item>
		<item>
		<title>how to debug EXC_BAD_ACCESS on iPhone</title>
		<link>http://www.codza.com/how-to-debug-exc_bad_access-on-iphone</link>
		<comments>http://www.codza.com/how-to-debug-exc_bad_access-on-iphone#comments</comments>
		<pubDate>Sun, 01 Nov 2009 06:41:10 +0000</pubDate>
		<dc:creator>lajos</dc:creator>
		
		<category><![CDATA[apple]]></category>

		<category><![CDATA[iphone]]></category>

		<category><![CDATA[mac]]></category>

		<category><![CDATA[debug]]></category>

		<category><![CDATA[EXC_BAD_ACCESS]]></category>

		<guid isPermaLink="false">http://www.codza.com/?p=197</guid>
		<description><![CDATA[EXC_BAD_ACCESS. Debugging this one is on par with figuring out why the wife says &#8220;not tonight, honey.&#8221; And they are equally unfortunate situations.
Let&#8217;s see what we can do about EXC_BAD_ACCESS.
EXC_BAD_ACCESS happens when a message is sent to an object that has already been released. By the time the error is caught, the call stack is [...]]]></description>
			<content:encoded><![CDATA[<p>EXC_BAD_ACCESS. Debugging this one is on par with figuring out why the wife says &#8220;not tonight, honey.&#8221; And they are equally unfortunate situations.</p>
<p>Let&#8217;s see what we can do about EXC_BAD_ACCESS.</p>
<p><span id="more-197"></span>EXC_BAD_ACCESS happens when a message is sent to an object that has already been released. By the time the error is caught, the call stack is usually gone especially if dealing with multiple threads.</p>
<p>How nice would it be to keep a dummy around after the object is released that could stop execution, tell us what message was sent and show us the call stack&#8230; well, there&#8217;s a way to do just that.</p>
<p>If you set the NSZombieEnabled environment variable, the Objective C runtime will leave a dummy object behind for every deallocated object. When the zombie object is called, execution stops and you can see the message that was sent to the object and the call stack that tells you where the message came from (it doesn&#8217;t tell you where you over released the object, but knowing where the object is called from should get you pretty close to the problem.)</p>
<p>To set this variable, go to the info panel of the executable in xcode, and create a new <strong>environment variable</strong> in the <strong>arguments</strong> tab by clicking the plus sign in the lower left corner of the window. Name the variable <strong>NSZombieEnabled</strong>, type <strong>YES</strong> for the value and make sure that the checkbox is selected.</p>
<div id="attachment_198" class="wp-caption alignnone" style="width: 310px"><a href="http://www.codza.com/wp-content/uploads/2009/03/exc_01_execinfo.png"><img class="size-medium wp-image-198" title="exc_01_execinfo" src="http://www.codza.com/wp-content/uploads/2009/03/exc_01_execinfo-300x250.png" alt="set NSZombieEnabled variable" width="300" height="250" /></a><p class="wp-caption-text">set NSZombieEnabled variable</p></div>
<p>Go ahead and run your program now (in debug mode, because you need the stack information.) When the over released object is accessed, you get an error message similar to this (xcode debug view):</p>
<pre>2009-03-30 02:30:36.172 ninjaJumper[3997:20b] *** -[GameLayer retain]: message sent
to deallocated instance 0x59bf670</pre>
<p>This shows the class of the object (GameLayer) and the message sent (retain).</p>
<p>Let&#8217;s take a look at the stack now:</p>
<div id="attachment_199" class="wp-caption alignnone" style="width: 310px"><a href="http://www.codza.com/wp-content/uploads/2009/03/exc_03_stack.png"><img class="size-medium wp-image-199" title="exc_03_stack" src="http://www.codza.com/wp-content/uploads/2009/03/exc_03_stack-300x123.png" alt="call stack" width="300" height="123" /></a><p class="wp-caption-text">call stack</p></div>
<p>The methods printed in <strong>bold </strong>are in your code, the others are in some other API. Here you can see that the object was accessed from [Director touchesBegan:withEvent], where an array was copied (most likely the over released object was in the array.)</p>
<p>This information should get you pretty close to the problem.</p>
<p>Once the problem is fixed, make sure that the NSZombieEnabled variable is disabled. You don&#8217;t need to delete it, but make sure that the checkbox is unchecked:</p>
<div id="attachment_200" class="wp-caption alignnone" style="width: 269px"><a href="http://www.codza.com/wp-content/uploads/2009/03/exc_05_nonszombie.png"><img class="size-full wp-image-200" title="exc_05_nonszombie" src="http://www.codza.com/wp-content/uploads/2009/03/exc_05_nonszombie.png" alt="NSZombie disabled" width="259" height="131" /></a><p class="wp-caption-text">NSZombie disabled</p></div>
<p>Now about the wife. Good luck there. Try a box of chocolate or load the dishwasher for a couple days.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codza.com/how-to-debug-exc_bad_access-on-iphone/feed</wfw:commentRss>
		</item>
		<item>
		<title>decoding a UTF-8 NSString</title>
		<link>http://www.codza.com/decoding-utf-8-nsstring</link>
		<comments>http://www.codza.com/decoding-utf-8-nsstring#comments</comments>
		<pubDate>Sat, 31 Oct 2009 06:53:17 +0000</pubDate>
		<dc:creator>lajos</dc:creator>
		
		<category><![CDATA[apple]]></category>

		<category><![CDATA[iphone]]></category>

		<category><![CDATA[mac]]></category>

		<category><![CDATA[decode]]></category>

		<category><![CDATA[NSString]]></category>

		<category><![CDATA[UTF-8]]></category>

		<guid isPermaLink="false">http://www.codza.com/?p=271</guid>
		<description><![CDATA[I came across this issue when I received a UTF-8 encoded string from a URL. I was expecting the UTF-8 string to be automatically decoded, but then I realized that it&#8217;s probably not trivial to identify a UTF-8 string, so NSString doesn&#8217;t automatically do this for a reason. (Unfortunately, this realization came only after I&#8217;d been [...]]]></description>
			<content:encoded><![CDATA[<p>I came across this issue when I received a UTF-8 encoded string from a URL. I was expecting the UTF-8 string to be automatically decoded, but then I realized that it&#8217;s probably not trivial to identify a UTF-8 string, so NSString doesn&#8217;t automatically do this for a reason. (Unfortunately, this realization came only after I&#8217;d been banging my head against the screen for an hour. Hence this post <img src='http://www.codza.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>There&#8217;s no method in the NSString API to decode a UTF-8 NSString directly, so first it has to be converted to a C string (gotta love those C strings.)</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span>encodedString;
<span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span>decodedString <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #400080;">NSString</span> stringWithUTF8String<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span>encodedString cStringUsingEncoding<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSString</span> defaultCStringEncoding<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.codza.com/decoding-utf-8-nsstring/feed</wfw:commentRss>
		</item>
		<item>
		<title>converting NSString to JSON string</title>
		<link>http://www.codza.com/converting-nsstring-to-json-string</link>
		<comments>http://www.codza.com/converting-nsstring-to-json-string#comments</comments>
		<pubDate>Fri, 30 Oct 2009 04:27:06 +0000</pubDate>
		<dc:creator>lajos</dc:creator>
		
		<category><![CDATA[apple]]></category>

		<category><![CDATA[iphone]]></category>

		<category><![CDATA[encode]]></category>

		<category><![CDATA[JSON]]></category>

		<category><![CDATA[NSString]]></category>

		<guid isPermaLink="false">http://www.codza.com/?p=285</guid>
		<description><![CDATA[I needed a quick way to encode an NSString to be used in a JSON object in an iPhone project. There are libraries to do this like TouchJSON, but I didn&#8217;t want to link a whole library to insert a string into a Facebook query.
A JSON string looks like this (image from json.org):

NSString is already [...]]]></description>
			<content:encoded><![CDATA[<p>I needed a quick way to encode an NSString to be used in a JSON object in an iPhone project. There are libraries to do this like <a href="http://code.google.com/p/touchcode/wiki/TouchJSON">TouchJSON</a>, but I didn&#8217;t want to link a whole library to insert a string into a <a href="http://www.facebook.com">Facebook</a> query.</p>
<p><span id="more-285"></span>A JSON string looks like this (image from <a href="http://json.org/">json.org</a>):</p>
<p><a href="http://www.codza.com/wp-content/uploads/2009/10/jsonstring.gif"><img class="alignnone size-full wp-image-286" title="jsonstring" src="http://www.codza.com/wp-content/uploads/2009/10/jsonstring.gif" alt="jsonstring" width="598" height="413" /></a></p>
<p>NSString is already UTF-8, but characters like \n have to be escaped. Here&#8217;s the method I came up with:</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">-</span><span style="color: #002200;">&#40;</span><span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>JSONString<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>aString <span style="color: #002200;">&#123;</span>
	<span style="color: #400080;">NSMutableString</span> <span style="color: #002200;">*</span>s <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #400080;">NSMutableString</span> stringWithString<span style="color: #002200;">:</span>aString<span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>s replaceOccurrencesOfString<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;<span style="color: #2400d9;">\&quot;</span>&quot;</span> withString<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;<span style="color: #2400d9;">\\</span><span style="color: #2400d9;">\&quot;</span>&quot;</span> options<span style="color: #002200;">:</span>NSCaseInsensitiveSearch range<span style="color: #002200;">:</span>NSMakeRange<span style="color: #002200;">&#40;</span><span style="color: #2400d9;">0</span>, <span style="color: #002200;">&#91;</span>s length<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span><span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>s replaceOccurrencesOfString<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;/&quot;</span> withString<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;<span style="color: #2400d9;">\\</span>/&quot;</span> options<span style="color: #002200;">:</span>NSCaseInsensitiveSearch range<span style="color: #002200;">:</span>NSMakeRange<span style="color: #002200;">&#40;</span><span style="color: #2400d9;">0</span>, <span style="color: #002200;">&#91;</span>s length<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span><span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>s replaceOccurrencesOfString<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;<span style="color: #2400d9;">\n</span>&quot;</span> withString<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;<span style="color: #2400d9;">\\</span>n&quot;</span> options<span style="color: #002200;">:</span>NSCaseInsensitiveSearch range<span style="color: #002200;">:</span>NSMakeRange<span style="color: #002200;">&#40;</span><span style="color: #2400d9;">0</span>, <span style="color: #002200;">&#91;</span>s length<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span><span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>s replaceOccurrencesOfString<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;<span style="color: #2400d9;">\b</span>&quot;</span> withString<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;<span style="color: #2400d9;">\\</span>b&quot;</span> options<span style="color: #002200;">:</span>NSCaseInsensitiveSearch range<span style="color: #002200;">:</span>NSMakeRange<span style="color: #002200;">&#40;</span><span style="color: #2400d9;">0</span>, <span style="color: #002200;">&#91;</span>s length<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span><span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>s replaceOccurrencesOfString<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;<span style="color: #2400d9;">\f</span>&quot;</span> withString<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;<span style="color: #2400d9;">\\</span>f&quot;</span> options<span style="color: #002200;">:</span>NSCaseInsensitiveSearch range<span style="color: #002200;">:</span>NSMakeRange<span style="color: #002200;">&#40;</span><span style="color: #2400d9;">0</span>, <span style="color: #002200;">&#91;</span>s length<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span><span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>s replaceOccurrencesOfString<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;<span style="color: #2400d9;">\r</span>&quot;</span> withString<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;<span style="color: #2400d9;">\\</span>r&quot;</span> options<span style="color: #002200;">:</span>NSCaseInsensitiveSearch range<span style="color: #002200;">:</span>NSMakeRange<span style="color: #002200;">&#40;</span><span style="color: #2400d9;">0</span>, <span style="color: #002200;">&#91;</span>s length<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span><span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>s replaceOccurrencesOfString<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;<span style="color: #2400d9;">\t</span>&quot;</span> withString<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;<span style="color: #2400d9;">\\</span>t&quot;</span> options<span style="color: #002200;">:</span>NSCaseInsensitiveSearch range<span style="color: #002200;">:</span>NSMakeRange<span style="color: #002200;">&#40;</span><span style="color: #2400d9;">0</span>, <span style="color: #002200;">&#91;</span>s length<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span><span style="color: #002200;">&#93;</span>;
	<span style="color: #a61390;">return</span> <span style="color: #002200;">&#91;</span><span style="color: #400080;">NSString</span> stringWithString<span style="color: #002200;">:</span>s<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.codza.com/converting-nsstring-to-json-string/feed</wfw:commentRss>
		</item>
		<item>
		<title>how to rename a mac and change the hostname in OS X</title>
		<link>http://www.codza.com/how-to-rename-a-mac-and-change-the-hostname-in-os-x</link>
		<comments>http://www.codza.com/how-to-rename-a-mac-and-change-the-hostname-in-os-x#comments</comments>
		<pubDate>Wed, 28 Oct 2009 18:18:16 +0000</pubDate>
		<dc:creator>lajos</dc:creator>
		
		<category><![CDATA[apple]]></category>

		<category><![CDATA[mac]]></category>

		<category><![CDATA[osx]]></category>

		<category><![CDATA[rename]]></category>

		<guid isPermaLink="false">http://www.codza.com/?p=293</guid>
		<description><![CDATA[The OS X registration process can come up with some pretty stupid computer names like chuck johnson&#8217;s macbook. This will show up in the Terminal, on the network and it has a freaking single quote and spaces in it ?!
Here&#8217;s how to rename it to something that makes sense, like pink.

Open System Preferences and click [...]]]></description>
			<content:encoded><![CDATA[<p>The OS X registration process can come up with some pretty stupid computer names like <strong>chuck johnson&#8217;s macbook</strong>. This will show up in the Terminal, on the network and it has a freaking single quote and spaces in it ?!</p>
<p>Here&#8217;s how to rename it to something that makes sense, like <strong>pink</strong>.</p>
<p><span id="more-293"></span></p>
<p>Open System Preferences and click on <strong>Sharing</strong> in the <strong>Internet&amp;Network</strong> section:</p>
<div id="attachment_294" class="wp-caption alignnone" style="width: 377px"><a href="http://www.codza.com/wp-content/uploads/2009/10/picture-3.png"><img class="size-full wp-image-294" title="picture-3" src="http://www.codza.com/wp-content/uploads/2009/10/picture-3.png" alt="System Preferences / Sharing" width="367" height="106" /></a><p class="wp-caption-text">System Preferences / Sharing</p></div>
<p>Change the <strong>Coumputer Name</strong> field:</p>
<div id="attachment_295" class="wp-caption alignnone" style="width: 310px"><a href="http://www.codza.com/wp-content/uploads/2009/10/picture-1.png"><img class="size-medium wp-image-295" title="picture-1" src="http://www.codza.com/wp-content/uploads/2009/10/picture-1-300x96.png" alt="Computer Name" width="300" height="96" /></a><p class="wp-caption-text">Computer Name</p></div>
<p>Click on the <strong>Edit</strong> button right below the <strong>Computer Name</strong> field and make sure the name you entered propagated here. You want to see something like <strong>pink.local</strong>:</p>
<div id="attachment_296" class="wp-caption alignnone" style="width: 310px"><a href="http://www.codza.com/wp-content/uploads/2009/10/picture-2.png"><img class="size-medium wp-image-296" title="picture-2" src="http://www.codza.com/wp-content/uploads/2009/10/picture-2-300x107.png" alt="Computer Name Edit" width="300" height="107" /></a><p class="wp-caption-text">Computer Name Edit</p></div>
<p>Last but not least, you should also change the host name (the system name of your machine). To do this, fire up <strong>Terminal</strong> (spotlight will find this for you) and type this command replacing <strong>pink</strong> with your name choice (you will also have to type your admin password):</p>
<pre>sudo scutil --set HostName pink.local</pre>
<p>Enjoy your now sanely named mac!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codza.com/how-to-rename-a-mac-and-change-the-hostname-in-os-x/feed</wfw:commentRss>
		</item>
		<item>
		<title>installing windows 7 from a USB stick</title>
		<link>http://www.codza.com/installing-windows-7-from-usb-stick</link>
		<comments>http://www.codza.com/installing-windows-7-from-usb-stick#comments</comments>
		<pubDate>Tue, 27 Oct 2009 21:18:50 +0000</pubDate>
		<dc:creator>lajos</dc:creator>
		
		<category><![CDATA[pc]]></category>

		<category><![CDATA[windows7]]></category>

		<category><![CDATA[install]]></category>

		<category><![CDATA[usb]]></category>

		<category><![CDATA[usb stick]]></category>

		<guid isPermaLink="false">http://www.codza.com/?p=308</guid>
		<description><![CDATA[Microsoft offers a tool to create a bootable USB stick (thumb drive? flash drive? floppy disk?) using a Windows7 ISO image, but if you purchased an educational/student copy of Windows7, it won&#8217;t work for you.
Don&#8217;t be sad, you can create a bootable USB stick installer from the online download. It&#8217;s easy, although you&#8217;ll have to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.microsoft.com">Microsoft</a> offers a<a href="http://store.microsoft.com/Help/ISO-Tool"> tool to create a bootable USB stick</a> (thumb drive? flash drive? floppy disk?) using a Windows7 ISO image, but if you purchased an educational/student copy of Windows7, it won&#8217;t work for you.</p>
<p><span id="more-308"></span>Don&#8217;t be sad, you can create a bootable USB stick installer from the online download. It&#8217;s easy, although you&#8217;ll have to get your hands a bit dirty.</p>
<p>You&#8217;ll need two utilities:</p>
<ul>
<li><a href="http://gocoding.com/page.php?al=petousb">PeToUSB</a> to format your USB stick (get the latest version)</li>
<li><a href="http://www.codza.com/files/BootSect.zip">BootSect</a> (I don&#8217;t know who made this awesome tool, you can download it <a href="http://www.codza.com/files/BootSect.zip">from here</a>)</li>
</ul>
<p>First, format your USB stick (must be 4gb or larger) with PeToUSB (obviously this will wipe out all files on your USB stick). Under format options make sure that you check:</p>
<ul>
<li>Enable Disk format</li>
<li>Enable LBA (FAT16x)</li>
</ul>
<p>Leace everything else unchecked. Drive label can be whatever. Here&#8217;s a screenshot:</p>
<div id="attachment_317" class="wp-caption alignnone" style="width: 418px"><a href="http://www.codza.com/wp-content/uploads/2009/10/win7usb1.jpg"><img class="size-full wp-image-317" title="win7usb1" src="http://www.codza.com/wp-content/uploads/2009/10/win7usb1.jpg" alt="PeToUSB format" width="408" height="422" /></a><p class="wp-caption-text">PeToUSB format</p></div>
<p>Extract BootSect.zip somewhere, for example <strong>c:\temp</strong>.</p>
<p>Now fire up command prompt (windows button+r, type cmd). Go to the folder where BootSect is, for example:</p>
<pre>cd c:\temp\bootsect</pre>
<p>Assuming your USB stick is drive <strong>d:</strong>, type (otherwise replace <strong>d</strong> with your drive letter):</p>
<pre>bootsect /nt60 d:</pre>
<p>You should see something like this:</p>
<div id="attachment_311" class="wp-caption alignnone" style="width: 687px"><a href="http://www.codza.com/wp-content/uploads/2009/10/win7usb2.png"><img class="size-full wp-image-311" title="win7usb2" src="http://www.codza.com/wp-content/uploads/2009/10/win7usb2.png" alt="bootsect /nt60 d:" width="677" height="342" /></a><p class="wp-caption-text">bootsect /nt60 d:</p></div>
<p>Now your USB stick is ready for the Windows7 installation files.</p>
<p>First you have to run the installer to unpack the installation files from the <strong>box</strong> files. As soon as unloading is done and the installation screen appears, you can close the installer. You&#8217;ll have a new folder called<strong> expandedSetup</strong>:</p>
<div id="attachment_313" class="wp-caption alignnone" style="width: 602px"><a href="http://www.codza.com/wp-content/uploads/2009/10/win7usb31.png"><img class="size-full wp-image-313" title="win7usb31" src="http://www.codza.com/wp-content/uploads/2009/10/win7usb31.png" alt="unboxed windows7 installer" width="592" height="121" /></a><p class="wp-caption-text">unboxed windows7 installer</p></div>
<p>In command prompt cd to the expandedSetup folder, for example:</p>
<pre>cd \Users\lajos\Desktop\win7_32\expandedSetup</pre>
<p>Copy the installation files to the USB stick using xcopy:</p>
<pre>xcopy *.* /s /e /f d:</pre>
<p>Now sip on your favorite drink for a while <img src='http://www.codza.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> When xcopy finishes, you&#8217;ll have a Windows7 USB stick installer!</p>
<p>Reboot your computer from the USB stick and the Windows7 installer should start up.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codza.com/installing-windows-7-from-usb-stick/feed</wfw:commentRss>
		</item>
		<item>
		<title>suppress layer numbers in Export Layers To Files</title>
		<link>http://www.codza.com/suppress-layer-numbers-in-export-layers-to-files</link>
		<comments>http://www.codza.com/suppress-layer-numbers-in-export-layers-to-files#comments</comments>
		<pubDate>Sun, 18 Oct 2009 21:10:32 +0000</pubDate>
		<dc:creator>lajos</dc:creator>
		
		<category><![CDATA[apple]]></category>

		<category><![CDATA[pc]]></category>

		<category><![CDATA[web]]></category>

		<category><![CDATA[export]]></category>

		<category><![CDATA[numbers]]></category>

		<category><![CDATA[photoshop]]></category>

		<category><![CDATA[png]]></category>

		<category><![CDATA[remove]]></category>

		<category><![CDATA[suppress]]></category>

		<guid isPermaLink="false">http://www.codza.com/?p=302</guid>
		<description><![CDATA[Adobe Photoshop CS4 comes with a script that exports layers to files, but it adds layer numbers to the file names by default. After lots of manual renaming I decided to add an option to suppress the layer numbers.

You can download the modified Export Layers To Files script from here. Unzip the file and overwrite [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.adobe.com/products/photoshop/photoshop/">Adobe Photoshop CS4</a> comes with a script that exports layers to files, but it adds layer numbers to the file names by default. After lots of manual renaming I decided to add an option to suppress the layer numbers.</p>
<p><span id="more-302"></span></p>
<p>You can download the <a href="http://www.codza.com/files/ExportLayersToFiles.zip">modified Export Layers To Files script from here</a>. Unzip the file and overwrite the original one in Photoshop CS4&#8217;s Presets/Scripts folder (to try it, run it from Photoshop&#8217;s File/Scripts/Browse menu ).</p>
<div id="attachment_303" class="wp-caption alignnone" style="width: 499px"><a href="http://www.codza.com/wp-content/uploads/2009/10/exportlayerstofilesnumbers.png"><img class="size-full wp-image-303" title="exportlayerstofilesnumbers" src="http://www.codza.com/wp-content/uploads/2009/10/exportlayerstofilesnumbers.png" alt="export layers to files, option to suppress layer numbers" width="489" height="496" /></a><p class="wp-caption-text">export layers to files, option to suppress layer numbers</p></div>
<p>The script was originally written by Naoki Hada and Tom Ruark, Copyright 2007.  Adobe Systems, Incorporated.</p>
<p>I added the same option to <a href="http://www.pretentiousname.com">Leo Davidson</a>&#8217;s modified Export Layers To Files (Fast PNG version) script. That script works with Photoshop CS3, you can <a href="http://www.codza.com/files/ExportLayersToFiles-FastPNGversion.zip">grab it from here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codza.com/suppress-layer-numbers-in-export-layers-to-files/feed</wfw:commentRss>
		</item>
		<item>
		<title>dw1510 windows xp drivers</title>
		<link>http://www.codza.com/dw1510-windows-xp-drivers</link>
		<comments>http://www.codza.com/dw1510-windows-xp-drivers#comments</comments>
		<pubDate>Sat, 17 Oct 2009 14:42:37 +0000</pubDate>
		<dc:creator>lajos</dc:creator>
		
		<category><![CDATA[pc]]></category>

		<category><![CDATA[acer aspire one]]></category>

		<category><![CDATA[aod250]]></category>

		<category><![CDATA[driver]]></category>

		<category><![CDATA[dw1510]]></category>

		<guid isPermaLink="false">http://www.codza.com/?p=288</guid>
		<description><![CDATA[I&#8217;ve recently replaced the network card in my Acer Aspire One 250 netbook with a Dell DW1510.I had some trouble finding the drivers on Dell&#8217;s site, so I&#8217;m posting the info here.
The DW1510 uses the Broadcom 4322 chip and supports 802.11n wireless networks and seems to have better reception than the original card. I bought [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently replaced the network card in my <a href="http://www.acer.us/showrooms/aspireone/">Acer Aspire One 250</a> netbook with a Dell DW1510.I had some trouble finding the drivers on <a href="http://www.dell.com">Dell</a>&#8217;s site, so I&#8217;m posting the info here.</p>
<p><span id="more-288"></span>The DW1510 uses the <a href="http://www.broadcom.com/products/Wireless-LAN/802.11-Wireless-LAN-Solutions/BCM4322">Broadcom 4322</a> chip and supports 802.11n wireless networks and seems to have better reception than the original card. I bought the card for &lt;$20 on <a href="http://www.ebay.com">eBay</a>. It&#8217;s a great upgrade.</p>
<p>The correct driver that work with Windows XP is here: <a href="http://support.dell.com/support/downloads/download.aspx?c=us&amp;l=en&amp;s=gen&amp;releaseid=R208883&amp;SystemID=INSPIRON10V&amp;servicetag=&amp;os=WW1&amp;osl=en&amp;deviceid=16119&amp;devlib=0&amp;typecnt=0&amp;vercnt=1&amp;catid=-1&amp;impid=-1&amp;formatcnt=1&amp;libid=5&amp;fileid=292805">Dell Wireless WLAN 1510 Half MiniCard (4322)</a>. The file is called <a href="http://support.dell.com/support/downloads/download.aspx?c=us&amp;l=en&amp;s=gen&amp;releaseid=R208883&amp;SystemID=INSPIRON10V&amp;servicetag=&amp;os=WW1&amp;osl=en&amp;deviceid=16119&amp;devlib=0&amp;typecnt=0&amp;vercnt=1&amp;catid=-1&amp;impid=-1&amp;formatcnt=1&amp;libid=5&amp;fileid=292805">DELL_MULTI-DEVICE_A23_208883.exe</a>.</p>
<p>You should know that if you are installing this card in a non-Dell computer, the Dell installer will not work. You will have to manually update the drivers. Run the installer. You can exit the installation after the files are extracted, although it will exit on it&#8217;s own complaining about your hardware if you continue <img src='http://www.codza.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Right click on <strong>My Computer</strong>, select <strong>Manage</strong>. Select the <strong>Device Manager</strong>, you should see your network card with a yellow question mark show up in he list of devices. Right click on it, select <strong>Update Driver</strong>&#8230; Select <strong>Install from a list of specific locations (advanced)</strong>. In the <strong>Include this location in search</strong> fiels browse to the extracted driver package, the folder you want to select is called <strong>DRIVER </strong>(under dell/drivers/R208883). Proceed with the installation and enjoy your new wireless card!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codza.com/dw1510-windows-xp-drivers/feed</wfw:commentRss>
		</item>
		<item>
		<title>provisioning profile not showing in 2.x project</title>
		<link>http://www.codza.com/provisioning-profile-not-showing-in-2x-project</link>
		<comments>http://www.codza.com/provisioning-profile-not-showing-in-2x-project#comments</comments>
		<pubDate>Sun, 11 Oct 2009 03:18:57 +0000</pubDate>
		<dc:creator>lajos</dc:creator>
		
		<category><![CDATA[apple]]></category>

		<category><![CDATA[iphone]]></category>

		<category><![CDATA[code signing]]></category>

		<category><![CDATA[provisioning profile not showing]]></category>

		<guid isPermaLink="false">http://www.codza.com/?p=278</guid>
		<description><![CDATA[I&#8217;ve recently worked on an update to MeanPhoto. The project was originally done using the iPhone SDK 2.1. I made the new distribution build with the 3.1.2 SDK without any issues, but when I uploaded the binary on iTunesConnect, I got an error saying that the app was not signed with an Apple provisioning profile.
I [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently worked on an update to <a href="http://www.itunes.com/app/meanphoto" mce_href="http://www.itunes.com/app/meanphoto">MeanPhoto</a>. The project was originally done using the iPhone SDK 2.1. I made the new distribution build with the 3.1.2 SDK without any issues, but when I uploaded the binary on iTunesConnect, I got an error saying that the app was not signed with an Apple provisioning profile.</p>
<p><img src="http://www.codza.com/wp-includes/js/tinymce/plugins/wordpress/img/trans.gif" mce_src="http://www.codza.com/wp-includes/js/tinymce/plugins/wordpress/img/trans.gif" alt="" class="mceWPmore mceItemNoResize" title="More...">I was surprised because I did not change any build settings. When I looked at the code signing key, I didn&#8217;t see any of the installed provisioning profiles:</p>
<div class="mceTemp">
<dl id="attachment_279" class="wp-caption alignnone" style="width: 310px;">
<dt class="wp-caption-dt"><a href="http://www.codza.com/wp-content/uploads/2009/10/npp-1.png" mce_href="http://www.codza.com/wp-content/uploads/2009/10/npp-1.png"><img class="size-medium wp-image-279" title="npp-1" src="http://www.codza.com/wp-content/uploads/2009/10/npp-1-300x109.png" mce_src="http://www.codza.com/wp-content/uploads/2009/10/npp-1-300x109.png" alt="no profiles showing up" height="109" width="300"></a></dt>
<dd class="wp-caption-dd">no profiles showing up</dd>
</dl>
</div>
<p>The provisioning profiles should show up like this:</p>
<div class="mceTemp">
<dl id="attachment_280" class="wp-caption alignnone" style="width: 310px;">
<dt class="wp-caption-dt"><a href="http://www.codza.com/wp-content/uploads/2009/10/npp-2.png" mce_href="http://www.codza.com/wp-content/uploads/2009/10/npp-2.png"><img class="size-medium wp-image-280" title="npp-2" src="http://www.codza.com/wp-content/uploads/2009/10/npp-2-300x86.png" mce_src="http://www.codza.com/wp-content/uploads/2009/10/npp-2-300x86.png" alt="provisioning profiles showing" height="86" width="300"></a></dt>
<dd class="wp-caption-dd">provisioning profiles showing</dd>
</dl>
</div>
<p>I checked a bunch of things from <a href="http://www.codza.com/how-to-fix-iphone-code-signing-errors" mce_href="http://www.codza.com/how-to-fix-iphone-code-signing-errors">my old post about code signing</a>, but I could not fix the issue.</p>
<p>I opened the <b>project.pbxproj </b>file (located in the .xcodeproj folder) and saw that while the <b>CODE_SIGNING_IDENTITY</b> was set, the <b>PROVISIONING_PROFILE</b> key was missing in the Distribution build settings section:</p>
<p><img src="file:///Users/lajos/Desktop/npp-3.png" mce_src="file:///Users/lajos/Desktop/npp-3.png" alt=""></p>
<div class="mceTemp">
<dl id="attachment_281" class="wp-caption alignnone" style="width: 310px;">
<dt class="wp-caption-dt"><a href="http://www.codza.com/wp-content/uploads/2009/10/npp-3.png" mce_href="http://www.codza.com/wp-content/uploads/2009/10/npp-3.png"><img class="size-medium wp-image-281" title="npp-3" src="http://www.codza.com/wp-content/uploads/2009/10/npp-3-300x95.png" mce_src="http://www.codza.com/wp-content/uploads/2009/10/npp-3-300x95.png" alt="PROVISIONING_PROFILE missing" height="95" width="300"></a></dt>
<dd class="wp-caption-dd">PROVISIONING_PROFILE missing</dd>
</dl>
</div>
<p>I created a temp project and selected the correct provisioning profile (in the new project I could select it with no problem). I opened the <b>.pbxproj</b> file from the temp project in a text editor (I use <a href="http://sourceforge.net/projects/smultron/" mce_href="http://sourceforge.net/projects/smultron/">Smultron</a> which is awesome) and copied the <b>PROVISIONING_PROFILE</b> setting to MeanPhoto&#8217;s <b>.pbxproj</b>:</p>
<div class="mceTemp">
<dl id="attachment_282" class="wp-caption alignnone" style="width: 310px;">
<dt class="wp-caption-dt"><a href="http://www.codza.com/wp-content/uploads/2009/10/npp-4.png" mce_href="http://www.codza.com/wp-content/uploads/2009/10/npp-4.png"><img class="size-medium wp-image-282" title="npp-4" src="http://www.codza.com/wp-content/uploads/2009/10/npp-4-300x94.png" mce_src="http://www.codza.com/wp-content/uploads/2009/10/npp-4-300x94.png" alt="PROVISIONING_PROFILE set" height="94" width="300"></a></dt>
<dd class="wp-caption-dd">PROVISIONING_PROFILE set</dd>
</dl>
</div>
<p>The provisioning profiles still don&#8217;t show up in XCode, but the new build uploaded to iTunes without a problem.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codza.com/provisioning-profile-not-showing-in-2x-project/feed</wfw:commentRss>
		</item>
	</channel>
</rss>
