<?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>mikemo</title>
	<atom:link href="http://www.morearty.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.morearty.com/blog</link>
	<description>Mike Morearty&#039;s blog</description>
	<lastBuildDate>Sun, 10 Apr 2011 23:24:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/>		<item>
		<title>fdb, the Flex debugger: Internals of how stepping works</title>
		<link>http://www.morearty.com/blog/2011/04/10/fdb-the-flex-debugger-internals-of-how-stepping-works/</link>
		<comments>http://www.morearty.com/blog/2011/04/10/fdb-the-flex-debugger-internals-of-how-stepping-works/#comments</comments>
		<pubDate>Sun, 10 Apr 2011 23:24:19 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Flash/Flex/Flex Builder]]></category>

		<guid isPermaLink="false">http://www.morearty.com/blog/?p=297</guid>
		<description><![CDATA[Since I left Adobe last year, I haven't done much work in Flash or Flex, so I haven't written much about them on this blog. (In fact, I haven't written very much about anything -- this poor blog has been somewhat neglected.) But a recent email exchange with Ilan Avigdor and Yoav Moran contained some [...]]]></description>
			<content:encoded><![CDATA[<p>Since I left Adobe last year, I haven't done much work in Flash or Flex, so I haven't written much about them on this blog.  (In fact, I haven't written very much about anything -- this poor blog has been somewhat neglected.)</p>

<p>But a recent email exchange with Ilan Avigdor and Yoav Moran contained some information that I think is worth sharing here.  They are "creating a tool for <a href="http://www.tikalk.com/flex/code-execution-viewer">visualizing code execution</a> for AS3," and had some questions about the internal workings of <code>fdb</code>, the free open-source command-line debugger that comes with the Flex SDK.  I wrote back to them with some details, and I thought I would repost my notes here.  (This post is pretty rough, because I'm just taking the email conversation, doing a little light editing, and then posting it.)</p>

<p>The part they wanted to know about is how stepping (step into, step over, etc.) is handled by fdb.</p>

<h3>A command-line debugger for Flex?  And it's free?  And it's open-source?</h3>

<p>But first: Yes, it's true, there is a free, open-source command-line debugger for Flex.  I get the feeling a lot of people are unaware of that.  Just as the command-line compiler, <code>mxmlc</code>, is free and open-source, the same is true of the debugger, <code>fdb</code>.  It, like all the other Flex tools, is written in Java.</p>

<p><code>fdb.jar</code> actually serves two purposes:</p>

<ol>
<li>It is a Java library with an API that is callable from any Java program you write.  E.g. if you wanted to write your own WYSIWYG Flex debugger, you could just put <code>fdb.jar</code> inside your app, and then call its Java API -- <code>stepInto()</code> and so on.</li>
<li>In addition, in the same jar is the command-line debugger.  The command-line debugger portion of <code>fdb.jar</code> makes calls to the API portion of <code>fdb.jar</code>.</li>
</ol>

<p>The Java library portion of <code>fdb.jar</code> is actually opening a socket and connecting to the Flash Player which is running in a separate process (e.g. in your web browser).  Yes, there is a wire protocol, so you don't <em>have</em> to use <code>fdb.jar</code> -- you could write directly to the wire protocol -- but that is harder, especially since the wire protocol isn't publicly documented.</p>

<h3>Reading the source</h3>

<p>Top-level location: <a href="http://opensource.adobe.com">http://opensource.adobe.com</a> -- this is the entry point for all of Adobe's open-source code.</p>

<p>Flex SDK location: <a href="http://opensource.adobe.com/svn/opensource/flex/sdk/trunk">http://opensource.adobe.com/svn/opensource/flex/sdk/trunk</a> -- this is a Subversion repo, so for example you can download all the sources with this command, to put them in a subdir called "flex" under the current directory:</p>

<pre><code>svn co http://opensource.adobe.com/svn/opensource/flex/sdk/trunk/ flex
</code></pre>

<p>(That will pull down a lot more than just fdb.)  fdb is in the <code>modules/debugger</code> subdirectory of that.  Under <code>modules/debugger</code>, <code>src/java/flash</code> contains the API portion, and <code>src/java/flex</code> contains the code for the command-line fdb program.  The class <code>flex.tools.debugger.cli.DebugCLI</code> is the entry class of the whole fdb program.</p>

<h3>How stepping works</h3>

<p>First, as in many debuggers, there are three kinds of stepping:</p>

<ul>
<li>Step into: Single-step, and if we step into a function call, then halt at the first line of that function call.</li>
<li>Step over: Step over the current line until we reach the next line of the current function.  Do not halt inside nested functions.</li>
<li>Step out: Step until we exit the current function.</li>
</ul>

<p>The function <code>runningLoop()</code> is one of the more important functions related to stepping: It is in charge of repeatedly telling the Flash player to resume until it decides it is time to stop.</p>

<p>Here is how stepping works:</p>

<p>When fdb sends any of the stepping-related commands to the flash player -- step in, step over, or step out -- the player says, "Okay then, how deep is the callstack at the present time?" and then uses either that number (for step over), or that number plus one (for step in), or that number minus one (for step out) as the target callstack depth for when the step command will be finished.  And Flash's opcode instruction set includes a "debugline" opcode that means "I am at the beginning of a line of source code" -- so the Flash player will only do this check of the callstack depth each time it reaches a "debugline" opcode.</p>

<p>E.g. suppose the callstack has three functions on it, and you call "step over".  Then the player records the number 3, which means, "the next time I reach a debugline opcode and the callstack depth is 3 or less, halt."  At that point, the code might call into another function (so the callstack depth will be 4), and that function might call into a whole bunch of others (so the callstack depth will keep getting deeper); but eventually it will pop back to the next line of the original function, and the callstack depth will be 3, and it will halt.</p>

<p>Next scenario: Instead of step over, you call "step in".  The player then records a target callstack depth of 4 -- again, this means, "the next time I reach a debugline opcode and the callstack depth is 4 or less, halt."  Which in essence means that the very next debugline opcode will cause it to halt, no matter whether the current line of code called another function (in which case the callstack depth will be 4, because you'll be in the new function), or just did something like an assignment to a variable (in which case it will be 3, because you'll be on the next line of the same function), or did a "return" (in which case it will be 2, because you will have returned to the caller).  But it'll halt.</p>

<p>Last scenario: You call "step out".  Then the player records a target callstack depth of 2.  It will keep stepping until the current function eventually returns.</p>

<p>Okay, so, your app: You always call "step in".  Now suppose the current callstack has only one function on it (so it has a callstack depth of 1); and you call "step in," so the player records this as "halt the next time we reach a debugline opcode and the callstack depth is 2 or less"; but then the current function does a "return".  We are no longer in ActionScript code -- the Flash player's native code is back in charge.  It can do whatever it wants, but the key point is, eventually, the next time it calls any ActionScript code for any reason, and a "debugline" opcode is encountered, the ActionScript part of the Flash player will notice that it is supposed to stop.  It doesn't matter that the code that is now executing is totally unrelated to the code that was executing before (e.g. the beginning of a new frame or whatever) -- it will stop.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.morearty.com/blog/2011/04/10/fdb-the-flex-debugger-internals-of-how-stepping-works/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I love plain text</title>
		<link>http://www.morearty.com/blog/2011/03/28/i-love-plain-text/</link>
		<comments>http://www.morearty.com/blog/2011/03/28/i-love-plain-text/#comments</comments>
		<pubDate>Mon, 28 Mar 2011 22:06:27 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://www.morearty.com/blog/?p=280</guid>
		<description><![CDATA[I'm a programmer, so I've always loved plain text, and I've always been bad at doing most things that require me to work with richer formats. For example, if you ask me to create some sort of schematic or diagram, I always spend way too long working on it, and it never comes out looking [...]]]></description>
			<content:encoded><![CDATA[<p>I'm a programmer, so I've always loved plain text, and I've always been bad at doing most things that require me to work with richer formats.  For example, if you ask me to create some sort of schematic or diagram, I always spend way too long working on it, and it never comes out looking very good.</p>

<p>That's why I am so excited with all the wonderful tools that are becoming more and more prevalent, that allow me to work in the medium in which I am so comfortable -- good old plain text -- and yet to output to very rich formats.</p>

<p>For example:</p>

<ul>
<li><p>I am writing this blog post in Markdown using the <a href="http://michelf.com/projects/php-markdown/">Markdown plugin for WordPress</a>.  Awesome!  i love it.  I no longer have to fight with the WordPress rich text editor.</p></li>
<li><p>I recently needed to create some <a href="http://en.wikipedia.org/wiki/Sequence_diagram">UML Sequence diagrams</a> to demonstrate flow through the different components of a program I was writing.  I'm on a Mac, so I can't use Visio.  I spent a long time looking at a number of different options, like OmniGraffle, Gliffy, and so on.  Finally, I found <a href="http://www.websequencediagrams.com/">websequencediagrams.com</a>, which is <em>awesome</em>.  It lets me write a plain-text description of the interactions between the components -- for example:</p>

<pre><code>iPhone-&gt;Server: send request
Server--&gt;iPhone: xml
</code></pre>

<p>... and it will instantly create the UML sequence diagram for me:</p>

<p><img src="http://www.websequencediagrams.com/cgi-bin/cdraw?lz=ICAgICAgICBpUGhvbmUtPlNlcnZlcjogc2VuZCByZXF1ZXN0CgAdCAAXBi0tPgAoBjogeG1sCg&amp;s=vs2010" alt="diagram" /></p>

<p>Once you have this capability, the possibilities are endless.  For example, websequencediagrams.com makes it <a href="http://www.websequencediagrams.com/embedding.html">easy to write your own scripts</a> in Python, Ruby, Java, or whatever, and create the sequence diagrams.  So the point is, I can create the text representation locally on my own computer and check it into source control, and then recreate the resulting diagram whenever I want.</p></li>
<li><p><a href="http://yuml.me/">yUML</a> is similar, but for other kinds of UML diagrams such as class diagrams.  Again, you just write it down in plain text, and it lays out and creates a pretty diagram.  For example, with this input:</p>

<pre><code>[Customer]1-0..*[Address]
</code></pre>

<p>... you get this image:</p>

<p><img src="http://yuml.me/diagram/scruffy/class/[Customer]1-0..*[Address]" /></p></li>
<li><p>In case it wasn't obvious, both of the above services make it easy to just put an <code>&lt;img&gt;</code> tag in your own web page and point to their server, and your diagram will show up.</p></li>
<li><p>And then there are things like <a href="http://johnmacfarlane.net/pandoc/">PanDoc</a>, which makes it possible to write an entire book in Markdown.  Today I came across <a href="http://openmymind.net/2011/3/28/The-Little-MongoDB-Book">The Little MongoDB Book</a> via Hacker News.  So the guy writes the book in Markdown, and then runs PanDoc which creates a very nice-looking PDF out of the whole thing.  And of course he stores the original Markdown in GitHub.</p></li>
</ul>

<p>This is the way things are supposed to be.  It feels so right.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.morearty.com/blog/2011/03/28/i-love-plain-text/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Mailing labels: Google vs. Apple</title>
		<link>http://www.morearty.com/blog/2010/12/19/mailing-labels-google-vs-apple/</link>
		<comments>http://www.morearty.com/blog/2010/12/19/mailing-labels-google-vs-apple/#comments</comments>
		<pubDate>Sun, 19 Dec 2010 08:00:44 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://www.morearty.com/blog/?p=237</guid>
		<description><![CDATA[For years, my wife and I have used Microsoft Excel + Microsoft Word to do mailing labels for Christmas cards. The workflow is weird and confusing, but at least we are familiar with it. Since I'm a Google fan and an Apple fan, and feel that both companies are really good at making things easy, [...]]]></description>
			<content:encoded><![CDATA[<p>For years, my wife and I have used Microsoft Excel + Microsoft Word to do mailing labels for Christmas cards. The workflow is weird and confusing, but at least we are familiar with it.</p>

<p>Since I'm a Google fan and an Apple fan, and feel that both companies are really good at making things easy, and since my wife and I are both on Macs now, I thought I'd see how good a job those companies do.</p>

<p>For Google, searched for info on how to do mailing labels in Google Docs. They claim to support labels, but their "solution" is hilariously bad: Start with a document template (people upload tons of them), and then manually change each label. Ha!</p>

<p>Apple's solution is hard to find (I found it by googling), but once you do find it, it's awesome. Export your list to a CSV file, then import the data into the Address Book app, and then say File &gt; Print. One of the printing choices is Labels; and you can specify which Avery label type you want, and you're done!</p>

<p>And they did a beautiful job of handling a few issues I was worried about:</p>

<ul>
<li>I don't normally use Address Book, so it was okay with me if it clobbered existing data that I had in there, but I was wondering if this would work for people who do actively use Address Book. It works fine. First I created a new "Group" called "Christmas Labels 2010". Then I imported into that group. If there are any imported entries that appear to be duplicates of existing entries, it asks me what I want to do (merge, keep both, etc.). I just told it to keep both. Then, after printing my labels, I deleted all the entries I had imported, and then deleted the group.</li>
<li>My Excel spreadsheet is formatted in a way that isn't really compatible with the Address Book fields. Address Book has separate fields for first name, last name, address, city, state, zip. My spreadsheet just had three columns: "Last Name" (which was actually the full name), "Street", and "City, State, Zip". When I imported, Address Book did a good job of guessing which field each one should go into, but of course it might import one entry with the last name "The Smith Family" and no first name, and the city "San Francisco, CA 94134", and no state or zip code. Okay, that's incorrect. But it wasn't a problem. When I said to print, the labels looked just fine. (And no, there was not an extra space before "The Smith Family" on the labels, even though it is trying to print "&lt;firstname&gt; &lt;lastname&gt;".)</li>
<li>Although by default it didn't guess the correct encoding of the CSV file, I was able to manually specify UTF-8, for the handful of entries that had special characters.</li>
<li>A few entries had text that was too long to fit in the default font. Address Book handles that gracefully -- it just printed those ones in a smaller font.</li>
</ul>

<p>So it's a knockout punch, Apple wins.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.morearty.com/blog/2010/12/19/mailing-labels-google-vs-apple/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash Builder 4 has shipped!</title>
		<link>http://www.morearty.com/blog/2010/03/22/flash-builder-4-has-shipped/</link>
		<comments>http://www.morearty.com/blog/2010/03/22/flash-builder-4-has-shipped/#comments</comments>
		<pubDate>Mon, 22 Mar 2010 18:11:16 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Flash/Flex/Flex Builder]]></category>

		<guid isPermaLink="false">http://www.morearty.com/blog/?p=228</guid>
		<description><![CDATA[Get yours today!]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.adobe.com/products/flex/">Get yours today!</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.morearty.com/blog/2010/03/22/flash-builder-4-has-shipped/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Flex Builder tip: How to dismiss the &#8220;Add Watch Expression&#8221; dialog from the keyboard</title>
		<link>http://www.morearty.com/blog/2009/05/18/flex-builder-tip-how-to-dismiss-the-add-watch-expression-dialog-from-the-keyboard/</link>
		<comments>http://www.morearty.com/blog/2009/05/18/flex-builder-tip-how-to-dismiss-the-add-watch-expression-dialog-from-the-keyboard/#comments</comments>
		<pubDate>Mon, 18 May 2009 21:54:27 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Flash/Flex/Flex Builder]]></category>

		<guid isPermaLink="false">http://www.morearty.com/blog/?p=218</guid>
		<description><![CDATA[One of the most common Flex Builder debugger complaints is that when you bring up the dialog to add a new expression to the Expressions view (e.g. via right-click > Add Watch Expression), you cannot dismiss this dialog using the keyboard alone. The dialog has a multi-line edit box, and if you press Return, that [...]]]></description>
			<content:encoded><![CDATA[<p>One <img align="right" src="http://www.morearty.com/blog/wp-content/uploads/2009/05/add-watch-expression-300x198.png" alt="add-watch-expression" title="add-watch-expression" width="300" height="198" class="alignnone size-medium wp-image-221" />of the most common Flex Builder debugger complaints is that when you bring up the dialog to add a new expression to the Expressions view (e.g. via right-click > Add Watch Expression), you cannot dismiss this dialog using the keyboard alone.  The dialog has a multi-line edit box, and if you press Return, that just adds a carriage return to the edit box. Similarly, trying to tab out of the edit box doesn't work -- it just inserts a tab character into the edit box.</p>

<p>This drives keyboard-heavy users (like me) crazy.  However, it turns out that there <em>is</em> a way to dismiss this dialog from the key:</p>

<p><strong>Type Shift+Return instead of Return.</strong></p>

<p>There is, in fact, a good reason why this dialog has a multi-line edit box.  As explained in this <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=271411">Eclipse bug</a>, some languages (including Java) allow you to enter more than just a simple expression into this box.  And since the dialog comes from Eclipse's code rather than from Flex Builder's, we can't just change it to have a single line.</p>

<p>Since this is such a common point of frustration for Flex Builder users, in the above-linked bug I have asked that they find some way to make this easier for people to deal with, e.g. by perhaps having a short message in the dialog mentioning Shift+Return.  But in any case, you now know the secret handshake -- enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.morearty.com/blog/2009/05/18/flex-builder-tip-how-to-dismiss-the-add-watch-expression-dialog-from-the-keyboard/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>AprilScript: ActionScript worst practices</title>
		<link>http://www.morearty.com/blog/2009/04/01/aprilscript-actionscript-worst-practices/</link>
		<comments>http://www.morearty.com/blog/2009/04/01/aprilscript-actionscript-worst-practices/#comments</comments>
		<pubDate>Wed, 01 Apr 2009 18:05:04 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[Flash/Flex/Flex Builder]]></category>

		<guid isPermaLink="false">http://www.morearty.com/blog/?p=202</guid>
		<description><![CDATA[In honor of the date, and in the spirit of the old Obfuscated C Code Contest, I've written a bit of code to demonstrate some of the more, shall we say, interesting things you can do with ActionScript. The code: package { import flash.display.* import flash.text.* public class AprilFools extends Sprite { エイプリルフール var Number [...]]]></description>
			<content:encoded><![CDATA[<p>In honor of the date, and in the spirit of the old Obfuscated C Code Contest, I've written a bit of code to demonstrate some of the more, shall we say, <em>interesting</em> things you can do with ActionScript.</p>

<p>The code:</p>

<pre>package {
    import flash.display.* 
    import flash.text.*

    public class AprilFools extends Sprite {
        エイプリルフール var Number = 4..toString()

        use namespace エイプリルフール

        function AprilFools()
        {
            get = set
            set = get

            with (createTextField())
                text = new Date(Number).toDateString()
        }

        function get get() { return Number + <>< {Number}
            b={"/"+Number.split(/\//)[0]*502.25}/>&lt;/>..@b }
        function set get(set) { Number = set+'/'+set/4 }

        function get set() { return Number }
        function set set(get) { Number = get }

        // nothing fun here
        function createTextField():TextField
        {
            stage.scaleMode = StageScaleMode.NO_SCALE;
            stage.align = StageAlign.TOP_LEFT;
            var textField:TextField = new TextField();
            textField.width = 1000;
            addChild(textField);
            return textField;
        }
    }
}

namespace エイプリルフール
</pre>

<p>The program's weak spot is creativity in terms of what it actually does -- just some static text output.  Pretty pathetic really.  All my effort went into the ActionScript.  <a href="/blog/wp-content/uploads/2009/04/aprilfools.swf">Click here</a> to see the result.  It's probably not worth the effort to try to figure out what it does before running it; that's not really the fun part.  The fun part is trying to figure out why the heck the thing compiles at all; what the individual lines of code actually mean; and what sick features of the language I am taking advantage of.  Tell me what you find.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.morearty.com/blog/2009/04/01/aprilscript-actionscript-worst-practices/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>All Flex developers, please do this.</title>
		<link>http://www.morearty.com/blog/2009/03/06/all-flex-developers-please-do-this/</link>
		<comments>http://www.morearty.com/blog/2009/03/06/all-flex-developers-please-do-this/#comments</comments>
		<pubDate>Fri, 06 Mar 2009 18:19:29 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[Flash/Flex/Flex Builder]]></category>

		<guid isPermaLink="false">http://www.morearty.com/blog/?p=196</guid>
		<description><![CDATA[Even if you aren't a Mac user, please do this to your Flex apps. Even if you aren't the kind of person who uses the scroll wheel on your mouse or two-finger scroll on your trackpad, please do it. If you do, you will make some of your users very very happy.]]></description>
			<content:encoded><![CDATA[<p>Even if you aren't a Mac user, please <a href="http://blog.pixelbreaker.com/flash/as30-mousewheel-on-mac-os-x/">do this</a> to your Flex apps.</p>

<p>Even if you aren't the kind of person who uses the scroll wheel on your mouse or two-finger scroll on your trackpad, please do it.</p>

<p>If you do, you will make some of your users very very happy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.morearty.com/blog/2009/03/06/all-flex-developers-please-do-this/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>How to capture the compilation options used by Flex Builder</title>
		<link>http://www.morearty.com/blog/2009/01/23/how-to-capture-the-compilation-options-used-by-flex-builder/</link>
		<comments>http://www.morearty.com/blog/2009/01/23/how-to-capture-the-compilation-options-used-by-flex-builder/#comments</comments>
		<pubDate>Fri, 23 Jan 2009 19:10:48 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[Flash/Flex/Flex Builder]]></category>

		<guid isPermaLink="false">http://www.morearty.com/blog/?p=186</guid>
		<description><![CDATA[Suppose you are trying to set up a nightly build system -- your developers use Flex Builder during the day, and you are creating an Ant task that runs every night. And you want the Ant task to use exactly the same build settings that are used by the developers. mxmlc and compc have a [...]]]></description>
			<content:encoded><![CDATA[<p>Suppose you are trying to set up a nightly build system -- your developers use Flex Builder during the day, and you are creating an Ant task that runs every night. And you want the Ant task to use exactly the same build settings that are used by the developers.</p>

<p><code>mxmlc</code> and <code>compc</code> have a <code>-dump-config</code> option to dump all settings to a file. Later, the settings in that file can be read back in with <code>-load-config</code>.</p>

<p>So, do this:</p>

<ul>
    <li>In Flex Builder, do Project Properties</li>
    <li>Click the "Flex Compiler" tab</li>
    <li>In the "Additional compiler arguments" box, add "-dump-config <em>full-path-to-output-file</em>". For example, on Windows, "-dump-config C:\myconfig.xml"; on Mac, "-dump-config /Users/<em>myname</em>/myconfig.xml". (If you use a relative path, the file will be put in some odd hard-to-find place.)</li>
    <li>Click OK.  If Build Automatically is on, just clicking OK will cause the file to be built; if it is off, do a build now.</li>
    <li>Now that the settings have been dumped, go back to your project settings and remove the <code>-dump-config</code> option.</li>
    <li>Tweak the settings file as necessary (one thing you will almost certainly want to do is change <code>&lt;debug&gt;true&lt;/debug&gt;</code> to <code>&lt;debug&gt;false&lt;/debug&gt;</code> if your nightly build is supposed to do a release build), and use it in your nightly build script.</li>
</ul>

<p>Please be aware that this only captures compiler settings; it doesn't capture all the other little things that Flex Builder does for you, like compiling Flex library projects that your project depends on, copying non-embedded assets to the output directory, optimizing modules for the application, extracting RSLs, copying the HTML template, and so on.</p>

<p>More info <a href="http://kb.adobe.com/selfservice/viewContent.do?externalId=kb404341">here</a>. Please read that, it has additional info you will probably need.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.morearty.com/blog/2009/01/23/how-to-capture-the-compilation-options-used-by-flex-builder/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Fun with the iPhone spell checker</title>
		<link>http://www.morearty.com/blog/2009/01/05/fun-with-the-iphone-spell-checker/</link>
		<comments>http://www.morearty.com/blog/2009/01/05/fun-with-the-iphone-spell-checker/#comments</comments>
		<pubDate>Tue, 06 Jan 2009 01:15:23 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://www.morearty.com/blog/?p=184</guid>
		<description><![CDATA[Going skiing next month. So I started typing some info into the calendar in my iPhone. I typed Donner, as in Donner Pass.  The iPhone "corrected" that to Dinner. Um, yeah, that's appropriate. (I'm also sick of the iPhone changing its to it's.  Its spell checker doesn't know what it's doing!) Any other funny ones?]]></description>
			<content:encoded><![CDATA[<p>Going skiing next month. So I started typing some info into the calendar in my iPhone.</p>

<p>I typed <em>Donner,</em> as in Donner Pass.  The iPhone "corrected" that to <em>Dinner</em>.</p>

<p>Um, yeah, <a href="http://en.wikipedia.org/wiki/Donner_Party">that's appropriate</a>.</p>

<p>(I'm also sick of the iPhone changing <em>its</em> to <em>it's</em>.  Its spell checker doesn't know what it's doing!)</p>

<p>Any other funny ones?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.morearty.com/blog/2009/01/05/fun-with-the-iphone-spell-checker/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>UI race conditions</title>
		<link>http://www.morearty.com/blog/2008/12/21/ui-race-conditions/</link>
		<comments>http://www.morearty.com/blog/2008/12/21/ui-race-conditions/#comments</comments>
		<pubDate>Mon, 22 Dec 2008 06:54:02 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[Flash/Flex/Flex Builder]]></category>

		<guid isPermaLink="false">http://www.morearty.com/blog/?p=176</guid>
		<description><![CDATA[I'm sure this has happened to you once in a while: You're doing several things at the same time on the computer, e.g. perhaps you click to launch some slow program, and while that is launching you go over to your web browser to kill a few seconds reading something.  You try to click a [...]]]></description>
			<content:encoded><![CDATA[<p>I'm sure this has happened to you once in a while: You're doing several things at the same time on the computer, e.g. perhaps you click to launch some slow program, and while that is launching you go over to your web browser to kill a few seconds reading something.  You try to click a link, but <em>oops</em> -- just when you were about to click it, the other program finishes loading, and you have accidentally clicked something in it.</p>

<p>A variation of that happened to me just today.  I decided to try Yahoo Chess (and I'm proud to say I won my game).  You enter a room, e.g. the beginner room, and then there is a list of tables; you click to join a particular table.  But every few seconds, the list of tables keeps refreshing, so the button you were about to click could have suddenly disappeared -- or worse, turned into a button for a different table you didn't intend to join.</p>

<p>What's interesting to me (I don't know why, maybe because I'm a geek) is that this is a real-life version (if using the computer is considered real life) of the sort of race condition horribleness we all run into when we write multithreaded code. Thread 1 tries to increment a variable, but <em>oops</em>, thread 2 sneaks in there and changes it!  Urgh.</p>

<p>Does this ever come up in <em>real</em> real life (as opposed to real life while using a computer)?  Yes, of course -- one good example is the awkward little dance we all do once in a while when trying to walk past someone else who is coming the other way. Both step to the right, oops, both step to the left, oops!</p>

<p>In the case of computer UI, I can think of two ways to alleviate this problem (I am not claiming any incredible insight here, I think these are pretty obvious):</p>

<ol>
    <li>Animation can help. E.g. in the example of the Yahoo Chess list of tables, when the list redraws, rather than having it redraw instantly as it does now, maybe the individual rows of the list should slide to their new positions.  That gives a person's eye the visual feedback, "Wait, don't click just now."  Animation is sort of the computer equivalent of what usually helps avoid this problem in real-life scenarios: Most of the time, the fact that you can see the other person moving and adapt to their movement gives your brain enough time to avoid a collision.</li>
    <li>Maybe disable the mouse (and keyboard if appropriate) for a fraction of a second, e.g. maybe 1/4 second, immediately after a change, e.g. immediately after the list of chess tables was updated, or immediately after a program opens a new window or dialog.</li>
</ol>

<p>Of course, it would often be appropriate to combine both of those techniques: disable the mouse, do the animation, and then re-enable the mouse.  If done that way, the mouse could be immediately re-enabled when the animation was done -- no need to wait for 1/4 second more after the animation is done, because the person has already had sufficient time to process what is happening and avoid an accidental click.</p>

<p>What do you think?  I'm sure none of this is terribly original -- I imagine lots of research on this topic has been done.  I just haven't come across it.  (Sometimes blogging scares me, because the Internet is so huge that no matter how original a particular thought of mine might be, the odds are extremely good that someone else has already had it, and has said it on the Internet, and thus it's already in the Google index, and so should I really bother.  Reminds me of a joke that A. Whitney Brown made many many years ago in Saturday Night Live: "There are a billion people in China.  Think about that.  That means if you're a one-in-a-million kind of guy, there are a thousand other people exactly like you.")</p>
]]></content:encoded>
			<wfw:commentRss>http://www.morearty.com/blog/2008/12/21/ui-race-conditions/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

