<?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>Field Guide to Programmers &#187; OSX</title>
	<atom:link href="http://www.fieldguidetoprogrammers.com/category/osx/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.fieldguidetoprogrammers.com</link>
	<description>Code, Toys, Bits of Odd Fluff</description>
	<lastBuildDate>Fri, 19 Jun 2009 16:05:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Why Apple Works</title>
		<link>http://www.fieldguidetoprogrammers.com/osx/why-apple-works/</link>
		<comments>http://www.fieldguidetoprogrammers.com/osx/why-apple-works/#comments</comments>
		<pubDate>Fri, 01 Feb 2008 13:33:41 +0000</pubDate>
		<dc:creator>jamiegrove</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[OSX]]></category>

		<guid isPermaLink="false">http://www.fieldguidetoprogrammers.com/blog/osx/why-apple-works/</guid>
		<description><![CDATA[Reg Braithwaite has a brilliant piece about Apple as a purveyor of hardware as opposed to software. Apple is in the hardware business: People who think of the argument as being Apple vs. Microsoft think of the two companies as being in the OS business. But Apple is not in the OS business, and hasn’t [...]]]></description>
			<content:encoded><![CDATA[<p>Reg Braithwaite has a brilliant piece about Apple as a purveyor of hardware as opposed to software.</p>
<p><a href="http://weblog.raganwald.com/2008/01/apple-is-hardware-company.html">Apple is in the hardware business</a>:</p>
<blockquote><p>People who think of the argument as being Apple vs. Microsoft think of the two companies as being in the OS business. But Apple is not in the OS business, and hasn’t been in that business since Jobs returned and quickly killed the OEM Macintosh market. Think of an iPod touch. Would anybody argue that when you buy an iPod you are buying a copy of OS X with a dongle that happens to play music attached to it? Seriously? is anybody complaining that they can’t transfer their copy of OS X from an iPod touch to whatever lame music player Microsoft is peddling this week?</p></blockquote>
<p>[Via: <a href="http://weblog.raganwald.com/welcome.html">raganwald</a>]</p>
<p>Yeah, so what if I&#8217;m a fan boy too.  <img src='http://www.fieldguidetoprogrammers.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.fieldguidetoprogrammers.com/osx/why-apple-works/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Create ZIP archives on a Mac without .DS_Store or .svn</title>
		<link>http://www.fieldguidetoprogrammers.com/osx/create-zip-archives-on-a-mac-without-ds_store-or-svn/</link>
		<comments>http://www.fieldguidetoprogrammers.com/osx/create-zip-archives-on-a-mac-without-ds_store-or-svn/#comments</comments>
		<pubDate>Wed, 14 Nov 2007 03:14:30 +0000</pubDate>
		<dc:creator>jamiegrove</dc:creator>
				<category><![CDATA[OSX]]></category>

		<guid isPermaLink="false">http://www.fieldguidetoprogrammers.com/blog/osx/create-zip-archives-on-a-mac-without-ds_store-or-svn/</guid>
		<description><![CDATA[I&#8217;ve been posting little zip archives of the latest scal on the site for awhile now using the nice &#8220;Create Archive&#8221; feature in OSX. Problem is, when you create a ZIP archive all of the happy Mac hidden directories come along for the ride. This includes .DS_Store. If the directory is under version control you [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been posting little zip archives of the latest scal on the site for awhile now using the nice &#8220;Create Archive&#8221; feature in OSX.  Problem is, when you create a ZIP archive all of the happy Mac hidden directories come along for the ride.  This includes .DS_Store.  If the directory is under version control you also get .svn directories too.</p>
<p>After playing about with a variety of methods (and nifty tools), I settled on using the good old zip command&#8217;s exclude directive (-x) to skip the hidden directories.<br />
<span id="more-26"></span><br />
The -x directive lets your specify files to skip while creating an archive.  It can also take a file as an argument, in which you might store a lot of directory patterns.</p>
<p>Here&#8217;s how you do it:</p>
<p>zip -vr scal_0.2.zip *  -x@exclude.lst</p>
<p>This will create an archive of all files in the current directory (with a recursive romp through sub directories) and skip any file that matches the patterns defined in the file exclude.lst.  My exclude.lst looks like this:</p>
<p>*.svn*<br />
*.DS_Store*<br />
exclude.lst</p>
<p>I include exclude.lst because it is in the same directory as my files and I do not want it included in the archive.  If you make a script out of this command, you can put the script filename in your exclude.lst file.</p>
<p>Enjoy!</p>
<p><code></p>
<pre class="codebox" style="width:450px;">
  adding: index.html    (in=8314) (out=2136) (deflated 74%)
  adding: javascripts/  (in=0) (out=0) (stored 0%)
  adding: javascripts/effects.js        (in=38685) (out=8904) (deflated 77%)
  adding: javascripts/prototype.js..    (in=124137) (out=28414) (deflated 77%)
  adding: javascripts/scal.js   (in=13987) (out=3486) (deflated 75%)
  adding: javascripts/scalplanner.js    (in=5440) (out=1416) (deflated 74%)
  adding: javascripts/unittest.js       (in=20202) (out=5049) (deflated 75%)
  adding: planner_test.html     (in=4472) (out=1486) (deflated 67%)
  adding: scal_unittest.html    (in=4023) (out=1264) (deflated 69%)
  adding: scaltester.html       (in=2710) (out=950) (deflated 65%)
  adding: scaltester_new.html   (in=8312) (out=2130) (deflated 74%)
  adding: slick_test.html       (in=1836) (out=808) (deflated 56%)
  adding: styles/       (in=0) (out=0) (stored 0%)
  adding: styles/images/        (in=0) (out=0) (stored 0%)
  adding: styles/images/blackback.jpg   (in=699) (out=369) (deflated 47%)
  adding: styles/images/blueback.jpg    (in=721) (out=541) (deflated 25%)
  adding: styles/images/blueline.jpg    (in=1089) (out=975) (deflated 10%)
  adding: styles/images/bullet_red.gif  (in=282) (out=208) (deflated 26%)
  adding: styles/images/close.gif       (in=167) (out=167) (stored 0%)
  adding: styles/images/next.gif        (in=875) (out=301) (deflated 66%)
  adding: styles/images/prev.gif        (in=879) (out=305) (deflated 65%)
  adding: styles/scal.css       (in=11114) (out=2600) (deflated 77%)
  adding: styles/scaltables.css (in=4052) (out=880) (deflated 78%)
  adding: styles/stylemain.css  (in=914) (out=340) (deflated 63%)
  adding: styles/test.css       (in=1291) (out=474) (deflated 63%)
total bytes=254201, compressed=63203 -> 75% savings
</pre>
<p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.fieldguidetoprogrammers.com/osx/create-zip-archives-on-a-mac-without-ds_store-or-svn/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Turning an AJAX Control into a Dashboard Widget</title>
		<link>http://www.fieldguidetoprogrammers.com/scal/turning-an-ajax-control-into-a-dashboard-widget/</link>
		<comments>http://www.fieldguidetoprogrammers.com/scal/turning-an-ajax-control-into-a-dashboard-widget/#comments</comments>
		<pubDate>Sat, 06 Oct 2007 13:49:20 +0000</pubDate>
		<dc:creator>jamiegrove</dc:creator>
				<category><![CDATA[OSX]]></category>
		<category><![CDATA[scal]]></category>

		<guid isPermaLink="false">http://www.fieldguidetoprogrammers.com/blog/scal/turning-an-ajax-control-into-a-dashboard-widget/</guid>
		<description><![CDATA[I wouldn&#8217;t say I&#8217;m a heavy user of Dashboard, but I really like the idea of creating widgets. Widgets are also used in the iPhone and iPod Touch, so if I ever make the switch [crave] there&#8217;s no doubt I&#8217;ll want to develop some useless toys for my $$$ toy. Since I&#8217;ve already developed a [...]]]></description>
			<content:encoded><![CDATA[<p><!--noadsense--><br />
I wouldn&#8217;t say I&#8217;m a heavy user of Dashboard, but I really like the idea of creating widgets.  Widgets are also used in the iPhone and iPod Touch, so if I ever make the switch [<i>crave</i>] there&#8217;s no doubt I&#8217;ll want to develop some useless toys for my $$$ toy.  <img src='http://www.fieldguidetoprogrammers.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Since I&#8217;ve already developed a <a href="http://www.fieldguidetoprogrammers.com/#scal">calendar control</a> using the Prototype js and scriptaculous frameworks, I have the basic materials I need to build the widget.</p>
<p>Before you begin, you might want to take a look at the  <a href="http://developer.apple.com/documentation/AppleApplications/Conceptual/Dashboard_Tutorial/index.html">Dashboard Widget Tutorial on Apple&#8217;s Developer site</a>.  I found it helpful, though ultimately I wanted to dig into the code.  You probably do to, so let&#8217;s take a look at the structure of a Widget.<br />
<span id="more-18"></span></p>
<h2>The Widget Structure</h2>
<p>Any widgets you&#8217;ve installed on your system are stored in ~/Library/Widgets.  If you look at that directory in the Finder, you will see something like this:</p>
<p><img src="http://www.fieldguidetoprogrammers.com/images/blog/widgets.jpg" alt="Mah Widgets" title="Mah Widgets" /></p>
<p>The Widget application file is an archive, just like most Mac applications.  This means you can open it up and see what&#8217;s going on under the hood.  You can also hack it if you want (customize menus, images, even code in some places).  This is one of the hallmarks of the MacOS and OSX.  Well, maybe that&#8217;s a bit strong.  Let&#8217;s just say the feature has been around for awhile and it&#8217;s kinda cool.</p>
<p>To reveal the contents of the widget, right click on the icon and choose &#8220;Show Package Contents&#8221;.  This will open the archive as a folder and show you all the goodies inside.</p>
<p><img src="http://www.fieldguidetoprogrammers.com/images/blog/scal_widget.jpg" alt="Scal's Goodies" title="Scal's Goodies" /></p>
<p><span style="color:red;">[TIP]</span> If you are a <a href="http://macromates.com/">TextMate</a> user, you can just drag the icon of the widget onto TextMate.  This will launch a new project using the Widget&#8217;s folder and give you easy editing access to all of files inside the Widget.</p>
<p>The basic structure of a Widget is pretty simple.  You have index.html, info.plist, a couple of png image files, and a stylesheet.  The images are used by Dashboard to show placement when you add the Widget and as an icon in the list of Widgets.  The plist file holds the base information about the control (name, size, etc).  The index.html file is of course where the action takes place.</p>
<p>The screenshot above shows a lot of files in addition to the basic four.  Don&#8217;t be scared.  These files are just the support files for prototype and scriptaculous and my calendar control (scal).  </p>
<h2>Scal Widget</h2>
<p><a href="http://www.fieldguidetoprogrammers.com/downloads/scalwidget.zip">Download Scal Widget (ZIP)</a></p>
<p>Once you&#8217;ve downloaded and expanded the ZIP archive, you can double-click the Scal.wdgt file to install the control in Dashboard. However, as I said above, you could also right click on the icon and choose &#8220;Show Package Contents&#8221; to open the widget as a folder.  Lastly, I set up Scal to use the &#8220;dashblack&#8221; theme, so if nothing else you can see how not-close my CSS is to Apple&#8217;s.</p>
<p><img src="http://www.fieldguidetoprogrammers.com/images/blog/dashboard.jpg" alt="Scal's on Dashboard" title="Scal's on Dashboard" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.fieldguidetoprogrammers.com/scal/turning-an-ajax-control-into-a-dashboard-widget/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

