<?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>Elliott&#039;s Blog &#187; OS X</title>
	<atom:link href="http://www.elliottsprehn.com/blog/category/os-x/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.elliottsprehn.com/blog</link>
	<description>Life Through Math, Algorithms and Code</description>
	<lastBuildDate>Sun, 22 May 2011 09:06:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Delete key issues with ^H (Ctrl-H) and ssh on OS X</title>
		<link>http://www.elliottsprehn.com/blog/2010/09/18/delete-key-issues-with-h-ctrl-h-and-ssh-on-os-x/</link>
		<comments>http://www.elliottsprehn.com/blog/2010/09/18/delete-key-issues-with-h-ctrl-h-and-ssh-on-os-x/#comments</comments>
		<pubDate>Sun, 19 Sep 2010 00:28:12 +0000</pubDate>
		<dc:creator>Elliott</dc:creator>
				<category><![CDATA[OS X]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.elliottsprehn.com/blog/?p=163</guid>
		<description><![CDATA[If you live in a Terminal window like I do and frequently connect to servers and other machines through ssh you&#8217;ve run across an issue where the delete key doesn&#8217;t seem to work when connected to a remote server in OS X with ssh. I find this happens when you ssh to an Ubuntu machine [...]]]></description>
			<content:encoded><![CDATA[<p>If you live in a Terminal window like I do and frequently connect to servers and other machines through ssh you&#8217;ve run across an <a href="http://hints.macworld.com/article.php?story=20040930002324870&amp;query=tab">issue</a> where the delete key doesn&#8217;t seem to work when connected to a remote server in OS X with ssh. I find this happens when you ssh to an Ubuntu machine and then run an editor like vim/emacs/pico/etc. The suggested fix is to check the checkbox under Preferences &gt; Settings &gt; Advanced called &#8220;Delete sends Ctrl-H&#8221;. Once this is checked the delete key works as expected&#8230; well almost!</p>
<p>You&#8217;ll soon find that with this enabled the delete key doesn&#8217;t seem to work when you&#8217;re typing in certain contexts in the Terminal and not connected to a remote server. An easy way to experience this is to run php and type some text and then hit delete. You&#8217;ll see the text ^H appear in the window but nothing will be deleted.</p>
<p>The issue here is that the local erase character is not configured to be ^H, but is instead ^? which means that while Ubuntu now understands the delete key, OS X doesn&#8217;t. Doh.</p>
<p>The fix is easy. Add this line to your .bash_profile in your home directory.</p>
<pre class="brush:bash">
stty erase ^H
</pre>
<p>Now the delete key will work as expected on both OS X and when connected to remove servers.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.elliottsprehn.com/blog/2010/09/18/delete-key-issues-with-h-ctrl-h-and-ssh-on-os-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ActionSctipt 3.0 Array Access Woes</title>
		<link>http://www.elliottsprehn.com/blog/2007/03/25/actionsctipt-30-array-access-woes/</link>
		<comments>http://www.elliottsprehn.com/blog/2007/03/25/actionsctipt-30-array-access-woes/#comments</comments>
		<pubDate>Sun, 25 Mar 2007 05:43:38 +0000</pubDate>
		<dc:creator>Elliott</dc:creator>
				<category><![CDATA[ActionScript 3.0]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[OS X]]></category>

		<guid isPermaLink="false">http://www.elliottsprehn.com/blog/2007/03/25/actionsctipt-30-array-access-woes/</guid>
		<description><![CDATA[With the recent launch of Apollo Beta I thought I&#8217;d look into Flex again for some fun and decided I&#8217;d write plist api so that Apollo applications could read and modify OS X plists in a sane maner. PList XML is particularly problematic because of how its structured: &#60;dict&#62; &#60;key&#62;Foods&#60;/key&#62; &#60;array&#62; &#60;dict&#62; &#60;key&#62;Chocolate&#60;/key&#62; &#60;true/&#62; &#60;/dict&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>With the recent launch of Apollo Beta I thought I&#8217;d look into Flex again for some fun and decided I&#8217;d write plist api so that Apollo applications could read and modify OS X plists in a sane maner.</p>
<p>PList XML is particularly problematic because of how its structured:</p>
<pre class="brush: xml">
    &lt;dict&gt;
        &lt;key&gt;Foods&lt;/key&gt;
        &lt;array&gt;
            &lt;dict&gt;
               &lt;key&gt;Chocolate&lt;/key&gt;
               &lt;true/&gt;
            &lt;/dict&gt;
        &lt;/array&gt;
    &lt;/dict&gt;
</pre>
<p>While this example is contrived we can see that keys are associated with the following element in dict[tionaries] and that array elements are just the elements inside array blocks. This makes tools like XPath less than stellar since nodes don&#8217;t have real ids and makes working with E4X awkward.</p>
<p>Instead I decided a layer of transparency would be best, so the previous structure could be represented as:</p>
<pre class="brush: js">
    Dictionary {
        "Foods" => Array [
              Dictionary {
                   "Chocolate" => true
              }
         ]
    }
</pre>
<p>The goal being that in the actionscript I can do <code>myPlist.Foods[0].Chocolate</code> and get true, and allow simple assignments so <code>myPlist.Foods[0] = "foo"</code> should automatically wrap that string in a PListString. Simple right?</p>
<p>Well in a language like ruby, yes, but AS3 makes it more complicated than it needs to be (in part due to the way ECMAScript works) and requires flash.utils.Proxy to be able to override the <strong>Array Access</strong> operator.</p>
<p>This is problematic as it means that PListArray cannot actually extend the Array class and still override the Array Access operator at the same time! Doh!. To add insult to injury the array access operator definition on the Array class doesn&#8217;t call a method that we can override.</p>
<p>This means making a Typed array that handles all input and output to allow wrapping is impossible, instead we&#8217;d need to resort to get() and set() methods which means you can&#8217;t actually use the PListArray in any method that requires an array in transparent manner.</p>
<p>This makes me question why Adobe chose to force a fragile base class on us for overriding the existing object operators like <code>delete</code> or the Array Access Operator.</p>
<p>Instead they should have used an interface, flash.utils.IProxy which allowed implementing methods for calling performing those actions. Then again we&#8217;re still in a bind since interface methods must all be public these new override methods would clutter the public API.</p>
<p>Seems to me the best solution would be a little syntax addition for array access such as:</p>
<pre class="brush:as3">
function object get():*
function object set( key:*, value:* ):void
function object delete( key:* ):void
</pre>
<p>And so on&#8230;</p>
<p>This would allow defining proper getters and setters for the array access and let users redefine the getter and setter methods on superclasses to implement proper Arrays without the need to extend a super class which may or may not be an option. Sweet too since we can do this without even extending the language by adding an &#8220;object&#8221; namespace. :)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.elliottsprehn.com/blog/2007/03/25/actionsctipt-30-array-access-woes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

