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

<channel>
	<title>eagleeye87</title>
	<atom:link href="http://www.eagleeye87.com/blog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.eagleeye87.com/blog</link>
	<description></description>
	<pubDate>Tue, 29 Jan 2008 04:14:00 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>iChat File Transfer Analysis</title>
		<link>http://www.eagleeye87.com/blog/?p=4</link>
		<comments>http://www.eagleeye87.com/blog/?p=4#comments</comments>
		<pubDate>Tue, 21 Aug 2007 19:10:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Cocoa]]></category>

		<category><![CDATA[Google Summer of Code]]></category>

		<guid isPermaLink="false">http://www.eagleeye87.com/blog/?p=4</guid>
		<description><![CDATA[Introduction

This summer I was fortunate enough to be selected as a student for Google Summer of Code 2007 to work on the Adium instant messenger.  My specific project focuses on improving support for Bonjour messaging.  I have worked on updating libezv which was originally written by my mentor, Andrew Wellington.  

Within the [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Introduction</strong></p>

<p>This summer I was fortunate enough to be selected as a student for <a href="http://code.google.com/soc/2007/">Google Summer of Code 2007</a> to work on the <a href="http://adiumx.com">Adium</a> instant messenger.  My specific <a href="http://code.google.com/soc/2007/adium/appinfo.html?csaid=E696490F8C0BCFD7">project</a> focuses on improving support for Bonjour messaging.  I have worked on updating <a href="http://allocinit.net/apps/libezv">libezv</a> which was originally written by my mentor, Andrew Wellington.  </p>

<p>Within the past month work  progressed towards the point where the last major feature was file transfer.  I found a rather insightful  <a href="http://lists.apple.com/archives/rendezvous-dev/2004/Feb/msg00044.html">post</a> to Apple&#8217;s rendezvous-dev mailing list which helped immensely in deciphering iChat&#8217;s file transfer process.</p>

<p>As mentioned in the post, iChat adds custom attributes to the <a href="http://www.xmpp.org/extensions/xep-0066.html">Jabber OOB Protocol</a>.  Unfortunately, these custom additions are the same portions lacking documentation.  After more research, I have deduced what exactly these attributes are and how to use them!</p>

<p><strong>File Transfer Process</strong></p>

<p>The process for a typical transfer from iChat starts with an xml message similar to the following:  </p>

<p><code>
&lt;message type=&quot;chat&quot; to=&quot;erich@computer&quot;&gt;<br />
  &lt;body&gt;Here is the file you asked for: &lt;/body&gt;<br />
  &lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;<br />
    &lt;body ichatballooncolor=&quot;#E68CBD&quot; ichattextcolor=&quot;#000000&quot;&gt;<br />
      &lt;font ABSZ=&quot;12&quot; face=&quot;Lucida Grande&quot;&gt;Here is the file you asked for: &lt;/font&gt;<br />
    &lt;/body&gt;<br />
  &lt;/html&gt;<br />
  &lt;x xmlns=&quot;jabber:x:event&quot;&gt;<br />
    &lt;composing/&gt;<br />
  &lt;/x&gt;<br />
  &lt;x xmlns=&quot;jabber:x:oob&quot;&gt;<br />
    &lt;url type=&quot;file&quot; size=&quot;4&quot; posixflags=&quot;000001A0&quot; mimeType=&quot;text/plain&quot;<br /> hfsflags=&quot;00000008&quot;&gt;http://192.168.1.100:40785/B554ECD98129158D/File.txt&lt;/url&gt;<br />
  &lt;/x&gt;<br />
&lt;/message&gt;<br />
</code></p>

<p>Most everything in the message is self explanatory except for the <code>posixflags</code> and <code>hfsflags</code> attributes.   Both attributes hint at their meaning, however, I didn&#8217;t know what exactly was necessary to process the information.  After some further documentation reading, the answer came rather easily.</p>

<p><strong>Attribute Values</strong></p>

<p><code>posixflags</code> proved the easier attribute to decipher.  In actuality this attribute merely gives the value for the <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSFileManager_Class/Reference/Reference.html#//apple_ref/doc/c_ref/NSFilePosixPermissions"><code>NSFilePosixPermissions</code></a> key in the file attribute dictionary converted to hexadecimal. Using this information then becomes as easy as converting the hexadecimal value to an <code>NSNumber</code> and then using <code>NSFileManager</code> to apply the value for the <code>NSFilePosixPermissions</code> key.</p>

<p>The meaning of <code>hfsflags</code> did not come as easily.  Actually, the answer didn&#8217;t come until I was nearly finished finding another way to get information about the file.  It turns out that hfsflags consists of the hexadecimal encoding of the <a href="http://developer.apple.com/documentation/Carbon/Reference/Finder_Interface/Reference/reference.html#//apple_ref/doc/constant_group/Finder_Flags"><code>finderFlags</code></a> member of the <a href="http://developer.apple.com/documentation/Carbon/Reference/Finder_Interface/Reference/reference.html#//apple_ref/c/tdef/FileInfo"><code>FileInfo</code></a> struct.  The Finder Flags describes information about a file or folder such as whether the item has a finder label or whether it is an alias.  Although the workaround mentioned before precluded any attempt at using this value, in theory application of the finderFlags would be as simple as recreating the <code>FileInfo</code> struct and then applying that information using a call to Carbon&#8217;s <a href="http://developer.apple.com/documentation/Carbon/Reference/File_Manager/Reference/reference.html#//apple_ref/c/func/FSSetCatalogInfo"><code>FSSetCatalogInfo()</code></a>.</p>

<p><strong>Conclusion</strong></p>

<p>Looking back the process to discover these attributes wasn&#8217;t very challenging, however, hopefully no one else will need to do research into what the <code>posixflags</code> and <code>hfsflags</code> attributes describe.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.eagleeye87.com/blog/?feed=rss2&amp;p=4</wfw:commentRss>
		</item>
		<item>
		<title>Cellular Automaton</title>
		<link>http://www.eagleeye87.com/blog/?p=5</link>
		<comments>http://www.eagleeye87.com/blog/?p=5#comments</comments>
		<pubDate>Tue, 02 Jan 2007 19:58:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Cocoa]]></category>

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

		<guid isPermaLink="false">http://www.eagleeye87.com/blog/?p=5</guid>
		<description><![CDATA[Two years ago I worked on an interesting research project with a friend.  In this project we examined a certain cellular automaton named Langton&#39;s Ants.  Cellular automata are infinite grid spaces in which each space possesses a certain state.  Spaces in Langton&#39;s Ants have one of two states, on or off.  [...]]]></description>
			<content:encoded><![CDATA[<p>Two years ago I worked on an interesting research project with a friend.  In this project we examined a certain cellular automaton named Langton&#39;s Ants.  Cellular automata are infinite grid spaces in which each space possesses a certain state.  Spaces in Langton&#39;s Ants have one of two states, on or off.  In this cellular automata, an &quot;ant&quot; traverses the infinite grid space. Each time the ant enters a square it follows a certain set of rules:</p>

<ol>
<li>If the square is &#39;on&#39; the ant rotates 90 degrees clockwise and then moves forward one square. </li>
<li>If the square is &#39;off&#39; the ant rotates 90 degrees counterclockwise and then moves forward one square. </li>
<li>When the ant leaves a square it switches the status.  </li>
</ol>

<p>Although these rules seem simple, the patterns produced are intriguing.  Because of this, I decided to adapt some of the code written for the research project into a screen saver for Mac OS X.  The screen saver randomly creates anywhere from 1 to 5 ants on a grid and then performs the simple rules for each ant.  The following image is a pattern created by a single &quot;ant.&quot;  </p>

<p><a href='http://www.eagleeye87.com/blog/wp-content/uploads/2007/08/cellularautomaton_1.png' title='cellularautomaton_1.png'><img src='http://www.eagleeye87.com/blog/wp-content/uploads/2007/08/cellularautomaton_1.png' alt='cellularautomaton_1.png' /></a></p>

<p><strong>Screen Saver</strong><br />
I am releasing the CellularAutomaton v1.0 screen saver today.  I have only tested this on Mac OS X 10.4.8 on Intel and PowerPC computers.  Because of this I do not know whether this will work on any version of Mac OS X below 10.4.8 (including 10.3.x and below).  I hope you enjoy watching the amazing display as much as I enjoyed researching the automaton.  </p>

<p><strong><a href='http://www.eagleeye87.com/blog/wp-content/uploads/2007/08/cellularautomaton.zip' title='cellularautomaton.zip'>Click here to Download</a></strong></p>

<p><strong>Installation</strong><br />
To use the screen saver simply double-click the CellularAutomaton.saver file.  Follow the directions and then navigate to the CellularAutomaton screen saver in the list of screen savers.     </p>

<p><strong>Images</strong>  If you ever wish to save a pattern that appears on your screen simply press the s key.  Once you hear a beep, a file starting with CellularAutomaton has been saved to your Desktop.   </p>

<p><em>Note: Because of this feature the s key will not stop the screen saver.</em> </p>

<p>I am interested to see all of the interesting images so feel free to <a href="mailto:eagleeye87@gmail.com?subject=CellularAutomaton%20Pictures">email</a> them to me.  I hope to  create a gallery of user-submitted images.   </p>

<p><strong>Options</strong> </p>

<p><a href='http://www.eagleeye87.com/blog/wp-content/uploads/2007/08/cellularautomatonoptions.png' title='cellularautomatonoptions.png'><img src='http://www.eagleeye87.com/blog/wp-content/uploads/2007/08/cellularautomatonoptions.png' alt='cellularautomatonoptions.png' /></a></p>

<p>As shown above, there are few preferences which allow you to change the display behavior of the screen saver.  </p>

<p><strong>Questions?</strong><br />
If you do have any questions or run into any problems either leave a comment on this post or <a href="mailto:eagleeye87@gmail.com?subject=CellularAutomaton">email</a> me.   </p>

<p><strong>Further Reading</strong><br />
If you are interested in cellular automata or specifically Langton&#39;s Ants I suggest you explore the following links: </p>

<p><a href="http://mathworld.wolfram.com/LangtonsAnt.html">Langton&#39;s Ants at Mathworld</a><br />
<a href="http://mathworld.wolfram.com/CellularAutomaton.html">Cellular automata at Mathworld</a> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.eagleeye87.com/blog/?feed=rss2&amp;p=5</wfw:commentRss>
		</item>
	</channel>
</rss>
