<?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>Here I Go Again... &#187; Programming</title>
	<atom:link href="http://www.lilback.com/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lilback.com</link>
	<description>The Musings &#38; Ramblings of Mark Lilback</description>
	<lastBuildDate>Mon, 16 Jan 2012 22:08:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>Sure, wipe out my bookmarks. Thanks, Apple.</title>
		<link>http://www.lilback.com/2011/10/13/sure-wipe-out-my-bookmarks-thanks-apple/</link>
		<comments>http://www.lilback.com/2011/10/13/sure-wipe-out-my-bookmarks-thanks-apple/#comments</comments>
		<pubDate>Thu, 13 Oct 2011 23:35:59 +0000</pubDate>
		<dc:creator>mark</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[xcode]]></category>
		<guid isPermaLink="false">http://www.lilback.com/?p=139</guid>
		<description><![CDATA[shareShare this on:Earlier today Xcode downloaded a documentation update for Lion. I didn&#8217;t think anything of it, until I needed to look up something. All of a sudden, none of my bookmarks in Xcode work! I know Xcode bookmarks really suck. I have to remember Mac OX bookmarks are above iOS bookmarks since you can&#8217;t]]></description>
			<content:encoded><![CDATA[<div class="rpxsocial rpx_tooltip" onclick="rpxWPsocial('Share:','Earlier today Xcode downloaded a documentation...','http://www.lilback.com/2011/10/13/sure-wipe-out-my-bookmarks-thanks-apple/','Sure, wipe out my bookmarks. Thanks, Apple.','Shared Sure, wipe out my bookmarks. Thanks, Apple.');"><span class="rpxsharebutton">share</span><div class="rpx_share_tip">Share this on:<br /><div class="rpx_social_icons"><div class="rpx_icon_small rpx_facebook_small" title="Facebook"></div><div class="rpx_icon_small rpx_twitter_small" title="Twitter"></div></div></div></div><p>Earlier today Xcode downloaded a documentation update for Lion. I didn&#8217;t think anything of it, until I needed to look up something. All of a sudden, none of my bookmarks in Xcode work!</p>
<p>I know Xcode bookmarks really suck. I have to remember Mac OX bookmarks are above iOS bookmarks since you can&#8217;t rename them. Theoretically I could have four links to &#8220;Foundation Framework Reference&#8221; and have no way to distinguish which is which. But I still make use of them. But in my mind, blowing away a crapload of bookmarks like this must mean that no one at Apple uses them. Which in my mind, just confirms how bad they suck.</p>
<p>Automatic updates are nice, but not when they blow away your data and screw up your workflow.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lilback.com/2011/10/13/sure-wipe-out-my-bookmarks-thanks-apple/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Help Me Name a Product</title>
		<link>http://www.lilback.com/2011/03/08/help-me-name-a-product/</link>
		<comments>http://www.lilback.com/2011/03/08/help-me-name-a-product/#comments</comments>
		<pubDate>Wed, 09 Mar 2011 00:33:04 +0000</pubDate>
		<dc:creator>mark</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Agile Monks]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[music videos]]></category>
		<guid isPermaLink="false">http://www.lilback.com/?p=125</guid>
		<description><![CDATA[shareShare this on: I&#8217;m finally getting close to shipping my first iPad app but have run into one roadblock. What should I call it? Right now I call it iMusicVideoPlayer because that&#8217;s what it does. However, I need something with more pizazz. So if you think you can help me out with a name (and]]></description>
			<content:encoded><![CDATA[<div class="rpxsocial rpx_tooltip" onclick="rpxWPsocial('Share:',' I\&#8217;m finally getting close to shipping m...','http://www.lilback.com/2011/03/08/help-me-name-a-product/','Help Me Name a Product','Shared Help Me Name a Product');"><span class="rpxsharebutton">share</span><div class="rpx_share_tip">Share this on:<br /><div class="rpx_social_icons"><div class="rpx_icon_small rpx_facebook_small" title="Facebook"></div><div class="rpx_icon_small rpx_twitter_small" title="Twitter"></div></div></div></div><p><img style="float:right;" src="http://www.lilback.com/files/2011/03/mvplogo.png" alt="New App Icon" title="mvplogo.png" border="0" width="206" height="206" /></p>
<p>I&#8217;m finally getting close to shipping my first iPad app but have run into one roadblock. What should I call it?</p>
<p>Right now I call it iMusicVideoPlayer because that&#8217;s what it does. However, I need something with more pizazz. So if you think you can help me out with a name (and get a credit in the app and on the product&#8217;s website), read on.</p>
<p><span id="more-125"></span></p>
<p>Lately I&#8217;ve become obsessed with watching music videos when I want to relax. However, Apple&#8217;s workflow for playing videos is gotta be the worst thing I&#8217;ve seen them produce.</p>
<p>Music Videos are added to iTunes, and are classified with Music. That means that when I&#8217;m listening to music, sometimes a video window will pop open and it blocks whatever I was working on. So I generally only use playlists that limit themselves to audio or video.</p>
<p>On the iPad, music videos are listed in the iPod application, but when you hit play it switches you to the Videos app. In this app, all your videos are shown as thumbnail images (12 per screen) sorted by the title. I&#8217;m approaching 200 music videos in my collection. Needless to say, scrolling through them 12 at a time really sucks. Especially when the artist name isn&#8217;t displayed. Also, when a video finishes, it doesn&#8217;t play another one. You have to scroll the list to select the next one you want to watch.</p>
<p>So my new app works just like the iPod application, but for videos. You can make playlists. You can browse by title, artist, or genre. And it works with more than Music Videos. You can transfer any video to your iPad to play with it. It can also link to or even download videos from YouTube. I&#8217;m also using it to store my collection of funny comedy clips from SNL.</p>
<p>What should I call it? <a href="mailto:mark@lilback.com">Email me</a> your suggestions. And if you have an iPad with Music Videos on it, I can set you up with a beta version.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lilback.com/2011/03/08/help-me-name-a-product/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>One line shell script to count lines of source code</title>
		<link>http://www.lilback.com/2010/12/01/one-line-shell-script-to-count-lines-of-source-code/</link>
		<comments>http://www.lilback.com/2010/12/01/one-line-shell-script-to-count-lines-of-source-code/#comments</comments>
		<pubDate>Wed, 01 Dec 2010 18:33:38 +0000</pubDate>
		<dc:creator>mark</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[MacSQL]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[shell script]]></category>
		<category><![CDATA[unix]]></category>
		<guid isPermaLink="false">http://www.lilback.com/?p=106</guid>
		<description><![CDATA[shareShare this on:Yes, I know counting lines of code isn&#8217;t an effective way to measure the complexity of a project. But it does offer an easy way to compare the size of different projects. So here&#8217;s a one line command/script to give you a count of all source files in the current directory and all]]></description>
			<content:encoded><![CDATA[<div class="rpxsocial rpx_tooltip" onclick="rpxWPsocial('Share:','Yes, I know counting lines of code isn\&#8217;t...','http://www.lilback.com/2010/12/01/one-line-shell-script-to-count-lines-of-source-code/','One line shell script to count lines of source code','Shared One line shell script to count lines of source code');"><span class="rpxsharebutton">share</span><div class="rpx_share_tip">Share this on:<br /><div class="rpx_social_icons"><div class="rpx_icon_small rpx_facebook_small" title="Facebook"></div><div class="rpx_icon_small rpx_twitter_small" title="Twitter"></div></div></div></div><p>Yes, I know counting lines of code isn&#8217;t an effective way to measure the complexity of a project. But it does offer an easy way to compare the size of different projects. So here&#8217;s a one line command/script to give you a count of all source files in the current directory and all subdirectories.</p>
<blockquote><pre>rm -f src-line-count; \
find . \( -name "*.m" -or -name "*.h" -or -name "*.c" -or -name "*.cpp" -or -name "*.mm" \) \
-exec cat {} >> src-line-count \; ; wc -l src-line-count; rm src-line-count</pre>
</blockquote>
<p>I&#8217;m working on two new products that will be released this year. My shared folder of code used across multiple projects is 4348. Project 1 is largely complete and is 3508 lines. Project 2 still has a ways to go and is 5495 lines. I&#8217;ll probably add another 2000 lines before it ships.</p>
<p>The big doozy is MacSQL and the MacSQL Framework. I haven&#8217;t updated them in a long time, and a big part was health problems and other issues in my life the last few years. But even trying to tackle modernizing that code is scary. It totals 158,193 lines of code. And I wrote 99.9% of that code myself. That does not include third party frameworks and source code, which is kept in a separate location that I didn&#8217;t bother to count because all of that code isn&#8217;t used. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.lilback.com/2010/12/01/one-line-shell-script-to-count-lines-of-source-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Always initialize pointers to nil</title>
		<link>http://www.lilback.com/2010/10/07/always-initialize-pointers-to-nil/</link>
		<comments>http://www.lilback.com/2010/10/07/always-initialize-pointers-to-nil/#comments</comments>
		<pubDate>Thu, 07 Oct 2010 22:41:56 +0000</pubDate>
		<dc:creator>mark</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[cocoa]]></category>
		<category><![CDATA[debugging]]></category>
		<guid isPermaLink="false">http://blogs.lilback.com/mark/?p=93</guid>
		<description><![CDATA[shareShare this on:I&#8217;m working on a pretty complex custom application for a client. It allows them to visually build complicated products for their website. Kinda like a Quark light. Anyway, I wanted to add some fancy Core Animation effects when I&#8217;m opening a window for the user to select an image to include. It worked]]></description>
			<content:encoded><![CDATA[<div class="rpxsocial rpx_tooltip" onclick="rpxWPsocial('Share:','I\&#8217;m working on a pretty complex custom a...','http://www.lilback.com/2010/10/07/always-initialize-pointers-to-nil/','Always initialize pointers to nil','Shared Always initialize pointers to nil');"><span class="rpxsharebutton">share</span><div class="rpx_share_tip">Share this on:<br /><div class="rpx_social_icons"><div class="rpx_icon_small rpx_facebook_small" title="Facebook"></div><div class="rpx_icon_small rpx_twitter_small" title="Twitter"></div></div></div></div><p>I&#8217;m working on a pretty complex custom application for a client. It allows them to visually build complicated products for their website. Kinda like a Quark light.</p>
<p>Anyway, I wanted to add some fancy Core Animation effects when I&#8217;m opening a window for the user to select an image to include. It worked great, until I tried running the version my build script uploaded. It kept crashing as soon as I tried to load the image loading code.</p>
<p>I eventually figure it must be a difference between Debug and Release targets, and low-and-behold, it is. In the release version, in some 3rd party code I included, they didn&#8217;t initialize a pointer.</p>
<blockquote><p><code>NSImage *image;</code></p></blockquote>
<p>I added <code>=nil</code> and the application no longer crashes.</p>
<p>I&#8217;m pretty certain I do this 99.9% of the time, but I&#8217;m going to be more vigilant when inspecting code written by others. And I&#8217;m making it a point to do more testing with a build of the Release target.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lilback.com/2010/10/07/always-initialize-pointers-to-nil/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Option Clicking Issues in Xcode</title>
		<link>http://www.lilback.com/2010/08/11/option-clicking-issues-in-xcode/</link>
		<comments>http://www.lilback.com/2010/08/11/option-clicking-issues-in-xcode/#comments</comments>
		<pubDate>Wed, 11 Aug 2010 18:23:35 +0000</pubDate>
		<dc:creator>mark</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[defaults]]></category>
		<category><![CDATA[nstextview]]></category>
		<category><![CDATA[text selection]]></category>
		<category><![CDATA[xcode]]></category>
		<guid isPermaLink="false">http://blogs.lilback.com/mark/?p=50</guid>
		<description><![CDATA[shareShare this on:Starting with Leopard, NSTextView added support for rectangular selections and non-contiguous selections. Personally I&#8217;ve never used these features. However, they do get in my way. You make a rectangular selection by holding the option key while you click and drag. For one, this changes the cursor to a crosshair that just looks wrong]]></description>
			<content:encoded><![CDATA[<div class="rpxsocial rpx_tooltip" onclick="rpxWPsocial('Share:','Starting with Leopard, NSTextView added suppor...','http://www.lilback.com/2010/08/11/option-clicking-issues-in-xcode/','Option Clicking Issues in Xcode','Shared Option Clicking Issues in Xcode');"><span class="rpxsharebutton">share</span><div class="rpx_share_tip">Share this on:<br /><div class="rpx_social_icons"><div class="rpx_icon_small rpx_facebook_small" title="Facebook"></div><div class="rpx_icon_small rpx_twitter_small" title="Twitter"></div></div></div></div><p>Starting with Leopard, NSTextView added support for rectangular selections and non-contiguous selections. Personally I&#8217;ve never used these features. However, they do get in my way.</p>
<p>You make a rectangular selection by holding the option key while you click and drag. For one, this changes the cursor to a crosshair that just looks wrong to me in a text view. Also, it interferes with drag a dropping a copy of some text.</p>
<p>Say I need to duplicate a string. Say I&#8217;m implementing initWithCoder: and encodeWithEncoder:. I&#8217;ll copy paste a bunch of lines real fast, like:</p>
<blockquote><pre>
-(id)initWithCoder:(NSEncoder*)coder
{
	self = [super init];
	self.value1 = [coder decodeObjectForKey:@"AM_SOMECLASS_VAL1"];
	self.value2 = [coder decodeObjectForKey:@"AM_SOMECLASS_VAL2"];
	self.value3 = [coder decodeObjectForKey:@"AM_SOMECLASS_VAL3"];
	return self;
}
-(void)encodeWithCoder:(NSCoder*)coder
{
	[coder encodeObject: self.value1 forKey:@""];
	[coder encodeObject: self.value2 forKey:@""];
	[coder encodeObject: self.value3 forKey:@""];
}
</pre>
</blockquote>
<p>Instead of typing the keys a second time, I&#8217;m going to quickly double click on a key in initWithCoder:, hold down option, and drag the key inside the appropriate line in encodeWithCoder:. That will work just like copy/paste, but I don&#8217;t have to switch between mouse and keyboard and it doesn&#8217;t erase whatever I have stored on the pasteboard.</p>
<p>Since Apple added rectangular selection, this would screw up a lot as I&#8217;d hit the option key too early and it would start a rectangular selection, not a drag-copy.</p>
<p>So I googled for a way to disable this, and boy did I have a hard time. And the solution is the defaults key NSProhibitMultipleTextSelectionByMouse. A google search returns only 3 links, the third one being to an old link to the older AppKit Release Notes.</p>
<p>So finally, here&#8217;s the solution. Use this command to disable this in Xcode:</p>
<blockquote><p>defaults write com.apple.Xcode NSProhibitMultipleTextSelectionByMouse -bool YES</p></blockquote>
<p>or disable it globally, as I did:</p>
<blockquote><p>defaults write NSGlobalDomain NSProhibitMultipleTextSelectionByMouse -bool YES</p></blockquote>
<p>This post is pretty verbose, but I really wanted to discuss this enough to make sure anyone else googling for this problem would find this and save themselves a lot of time.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lilback.com/2010/08/11/option-clicking-issues-in-xcode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Integrating Google Checkout With WebObjects</title>
		<link>http://www.lilback.com/2007/02/08/integrating-google-checkout-with-webobjects/</link>
		<comments>http://www.lilback.com/2007/02/08/integrating-google-checkout-with-webobjects/#comments</comments>
		<pubDate>Thu, 08 Feb 2007 23:04:45 +0000</pubDate>
		<dc:creator>mark</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[WebObjects]]></category>
		<guid isPermaLink="false">http://blogs.rtlabs.com/mark/2007/02/08/integrating-google-checkout-with-webobjects/</guid>
		<description><![CDATA[shareShare this on:I&#8217;ve been spending days on this. I kept getting messages that the socket to the app was being closed, and I couldn&#8217;t find out why. [2007-02-08 14:13:40 PST] &#60;workerthread7&#62; &#60;wohttpio&#62;: Unable to set socket timeout:Socket is closed &#60;/wohttpio&#62;&#60;/workerthread7&#62; Turns out that by calling com.google.checkout.sample.protocol.CallBackParser.getInstance().parseToJAXB(new InputSource(aRequest.contentInputStream())) either jaxb, the xml parser, or the google]]></description>
			<content:encoded><![CDATA[<div class="rpxsocial rpx_tooltip" onclick="rpxWPsocial('Share:','I\&#8217;ve been spending days on this. I kept ...','http://www.lilback.com/2007/02/08/integrating-google-checkout-with-webobjects/','Integrating Google Checkout With WebObjects','Shared Integrating Google Checkout With WebObjects');"><span class="rpxsharebutton">share</span><div class="rpx_share_tip">Share this on:<br /><div class="rpx_social_icons"><div class="rpx_icon_small rpx_facebook_small" title="Facebook"></div><div class="rpx_icon_small rpx_twitter_small" title="Twitter"></div></div></div></div><p>I&#8217;ve been spending days on this. I kept getting messages that the socket to the app was being closed, and I couldn&#8217;t find out why. </p>
<blockquote><p>[2007-02-08 14:13:40 PST] &lt;workerthread7&gt; &lt;wohttpio&gt;: Unable to set socket timeout:Socket is closed<br />
&lt;/wohttpio&gt;&lt;/workerthread7&gt;</p>
</blockquote>
<p>Turns out that by calling</p>
<blockquote><p>com.google.checkout.sample.protocol.CallBackParser.getInstance().parseToJAXB(new InputSource(aRequest.contentInputStream()))
</p>
</blockquote>
<p>either jaxb, the xml parser, or the google code was closing the input stream returned by the request, which was closing the socket to the web server. Instead, I changed the code to</p>
<blockquote><p>com.google.checkout.sample.protocol.CallBackParser.getInstance().parseToJAXB(new InputSource(new java.io.StringReader(aRequest.contentString())))</p>
</blockquote>
<p>and it works fine.</p>
<p>I figured I&#8217;d post this note so that if someone else runs into this problem, they&#8217;d hopefully find a solution via a Google search.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lilback.com/2007/02/08/integrating-google-checkout-with-webobjects/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

