<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.0.3" -->
<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/"
	>

<channel>
	<title>Wilcox Development Solutions Blog</title>
	<link>http://www.wilcoxd.com/blog</link>
	<description>Blog for project status and lab notes</description>
	<pubDate>Tue, 22 Apr 2008 16:54:49 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.3</generator>
	<language>en</language>
			<item>
		<title>Ryan (and wxWidgets) on The Web</title>
		<link>http://www.wilcoxd.com/blog/ryan-and-wxwidgets-on-the-web.html</link>
		<comments>http://www.wilcoxd.com/blog/ryan-and-wxwidgets-on-the-web.html#comments</comments>
		<pubDate>Tue, 22 Apr 2008 16:37:42 +0000</pubDate>
		<dc:creator>Ryan Wilcox</dc:creator>
		
	<category>General Information</category>
		<guid isPermaLink="false">http://www.wilcoxd.com/blog/ryan-and-wxwidgets-on-the-web.html</guid>
		<description><![CDATA[So I need to update my website a bit. After a bit o reorganization and backend rework. But, in the spirit of Useful Information Now, I&#8217;m going to make it easy for people to see my reputation online. For right now it&#8217;s just wxWidgets links, because I&#8217;m out of time (and I do have a [...]]]></description>
			<content:encoded><![CDATA[<p>So I need to update my website a bit. After a bit o reorganization and backend rework. But, in the spirit of Useful Information Now, I&#8217;m going to make it easy for people to see my reputation online. For right now it&#8217;s just wxWidgets links, because I&#8217;m out of time (and I do have a decent sized presence in the wx community), but I&#8217;ll add more links to categories eventually.</p>
<p><a href="http://www.wxwidgets.org/">wxWidgets</a> Community:</p>
<ul>
<li><a href="http://groups.google.com/group/comp.soft-sys.wxwindows/">wxWidgets mailing list/newsgroup</a>: <a href="http://groups.google.com/group/comp.soft-sys.wxwindows/search?group=comp.soft-sys.wxwindows&amp;q=Ryan+Wilcox&amp;qt_g=Search+this+group">Search &#8220;Ryan Wilcox&#8221;</a>. I&#8217;m not as active here as I used to be, opting usually for the web based forums (since they have an RSS feed that I can narrow down just the topics I&#8217;m interested in.)</li>
<li><a href="http://wxforum.shadonet.com/">WxWidgets Web Forum</a>: Search <a href="http://wxforum.shadonet.com/search.php?search_author=Ryan+Wilcox">&#8220;Ryan Wilcox&#8221;</a></li>
<li><a href="http://news.gmane.org/gmane.comp.lib.wxwidgets.devel">WxWidgets Developer List</a>: Most of my posts here either concern wxMac, or are patches for wxMac. Mostly little tweaky bug fixes here and there, to make the user experience better. Search &#8220;<a href="http://search.gmane.org/search.php?group=gmane.comp.lib.wxwidgets.devel&amp;query=Ryan+Wilcox">Ryan Wilcox</a>&#8220;</li>
<li>wxWidgets posts on <a href="http://www.wilcoxd.com/blog/">my blog</a>: search <a href="http://www.wilcoxd.com/blog/index.php?s=wxwidgets">wxWidgets</a>. You might also want to try <a href="http://www.wilcoxd.com/blog/index.php?s=wxWindows">wxWindows</a>, since I&#8217;ve been around since before the project&#8217;s name changed to wxWidgets.</li>
</ul>
]]></content:encoded>
			<wfw:commentRSS>http://www.wilcoxd.com/blog/ryan-and-wxwidgets-on-the-web.html/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Textmate and high level ASCII characters</title>
		<link>http://www.wilcoxd.com/blog/textmate-and-high-level-ascii-characters.html</link>
		<comments>http://www.wilcoxd.com/blog/textmate-and-high-level-ascii-characters.html#comments</comments>
		<pubDate>Mon, 14 Apr 2008 23:32:22 +0000</pubDate>
		<dc:creator>Ryan Wilcox</dc:creator>
		
	<category>Uncategorized</category>
		<guid isPermaLink="false">http://www.wilcoxd.com/blog/textmate-and-high-level-ascii-characters.html</guid>
		<description><![CDATA[Here&#8217;s a fun gotcha when creating commands for TextMate: if your command&#8217;s output is set to Create New Document on output, then that output must be either free of high level (extended) ASCII characters, or UTF-8.
If your output doesn&#8217;t conform to this rule, the new document populated by TextMate will be blank. Nada, nothing, just [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a fun gotcha when creating commands for TextMate: if your command&#8217;s output is set to Create New Document on output, then that output must be either free of high level (extended) ASCII characters, or UTF-8.</p>
<p>If your output doesn&#8217;t conform to this rule, the new document populated by TextMate will be blank. Nada, nothing, just blank.</p>
<p>Try this test:</p>
<ol>
<li>Create a file in TextMate with an extended character in it (umlauts are good, or say option-y). And something afterwards, to prove my point that nothing else comes through.</li>
<li>Save, and set the file encoding to UTF8</li>
<li>Create a new command: set its Input to None, Output to Create New Document, and Command(s) to <code>cat path/to/your/saved/file</code></li>
<li>Run command</li>
<li>Notice your output: just like you expected</li>
<li>Now Save your document as another encoding. Say MacRoman. (Make sure to replace your old file: we want the command to open this file now!)</li>
<li>Run the command</li>
<li>Notice there&#8217;s no output</li>
</ol>
<p>This might not seem like a big deal, but remember that any Unix command you run could return high ASCII text. Grepping through a source tree of MacRoman files, let&#8217;s say. </p>
<p>In cases where those extended characters can be discarded, there&#8217;s a great tool from <a href="http://ssdc.ucsd.edu/sw/">University of California at San Diego</a>: a Perl script called <a href="http://ssdc.ucsd.edu/sw/fix">fix</a>. Fix replaces extended ASCII characters (and other craziness) to spaces. (I like to put scripts like this in a <code>bin</code> folder in my home directory.)</p>
<p>So, if extended ASCII characters don&#8217;t matter to you, use fix like this:<br />
<code>cat path/to/your/saved/file | perl ~/bin/fix.pl -</code></p>
<p>If you really do care about those characters, and you can assume the source encoding, you can use iconv.<br />
<code>cat path/to/your/saved/file | iconv -f 'macroman' -t 'utf-8'</code></p>
<p>After all that, it should be noted that the Output: Show as HTML setting can accept extended ASCII characters. But if your output isn&#8217;t HTML&#8230;
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.wilcoxd.com/blog/textmate-and-high-level-ascii-characters.html/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Batching Requests to Amazon Web Services via pyaws</title>
		<link>http://www.wilcoxd.com/blog/batching-requests-to-amazon-web-services-via-pyaws.html</link>
		<comments>http://www.wilcoxd.com/blog/batching-requests-to-amazon-web-services-via-pyaws.html#comments</comments>
		<pubDate>Fri, 21 Mar 2008 20:49:02 +0000</pubDate>
		<dc:creator>Ryan Wilcox</dc:creator>
		
	<category>ResearchAndDevelopment</category>
		<guid isPermaLink="false">http://www.wilcoxd.com/blog/batching-requests-to-amazon-web-services-via-pyaws.html</guid>
		<description><![CDATA[PyAWS (originally py-Amazon by Mark Pilgrim), is a neat, simple, Python API for getting requests from Amazon Web Services.
But it doesn&#8217;t let you do any batching: allowed by the Amazon Web Services API to reduce requests.
THe other day I wrote py_aws batch: which uses PyAWS as a springboard for batch requests. Which I think is [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://pyaws.sourceforge.net/">PyAWS</a> (<a href="http://diveintomark.org/projects/">originally py-Amazon by Mark Pilgrim</a>), is a neat, simple, Python API for getting requests from Amazon Web Services.</p>
<p>But it doesn&#8217;t let you do any batching: allowed by the Amazon Web Services API to reduce requests.</p>
<p>THe other day I wrote py_aws batch: which uses PyAWS as a springboard for batch requests. Which I think is really neat, so I&#8217;m sharing it with the community at large.</p>
<p>So here it is: <a href="http://wilcoxd.com/drop/pyaws_batch.py">pyaws_batch.py</a> (Now Updated with right link!)
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.wilcoxd.com/blog/batching-requests-to-amazon-web-services-via-pyaws.html/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>appscript&#8217;s get syntax (advanced concepts)</title>
		<link>http://www.wilcoxd.com/blog/appscripts-get-syntax-advanced-concepts.html</link>
		<comments>http://www.wilcoxd.com/blog/appscripts-get-syntax-advanced-concepts.html#comments</comments>
		<pubDate>Sun, 24 Feb 2008 04:22:18 +0000</pubDate>
		<dc:creator>Ryan Wilcox</dc:creator>
		
	<category>Uncategorized</category>
		<guid isPermaLink="false">http://www.wilcoxd.com/blog/appscripts-get-syntax-advanced-concepts.html</guid>
		<description><![CDATA[So if you read my previous article on appscript&#8217;s get syntax, you might now be wondering how to do more advanced things with getters. For example, in the Finder with Applescript you can say:
tell app "Finder" to get selection
if you want the alias (and not a reference to the finder item you&#8217;re dealing with):
tell app [...]]]></description>
			<content:encoded><![CDATA[<p>So if you read my <a href="http://www.wilcoxd.com/blog/appscripts-get-syntax.html">previous article on appscript&#8217;s get syntax</a>, you might now be wondering how to do more advanced things with getters. For example, in the Finder with <a href="http://www.apple.com/applescript/">Applescript</a> you can say:</p>
<p><code>tell app "Finder" to get selection</code></p>
<p>if you want the alias (and not a reference to the finder item you&#8217;re dealing with):</p>
<p><code>tell app "Finder" to get selection as alias</code></p>
<p>So how do you do this in <a href="http://appscript.sourceforge.net/">appscript</a>? Read on&#8230;</p>
<p><a id="more-108"></a><br />
Technically what I describe below works for any command you issue via appscript, not just get(), but for simplicity of example I&#8217;ll just keep using get().</p>
<p>To get an alias from the Finder&#8217;s selection:</p>
<p><code style="white-space:pre"><br />
fndr = app("Finder")<br />
sel = fndr.selection() #get the selection (a list, technically)<br />
item1Alias = sel[0].get(resulttype=k.alias)  #get item 1 as alias<br />
print item1Alias<br />
</code></p>
<p>The line <code>item1Alias = sel[0].get(resulttype=k.alias)</code> is the main point, so it requires further examination.</p>
<p>Firstly, <code style="white-space:pre">item1Alias = sel[0]</code> gets a reference to the first item of the selection list. Even at this point, however, the first item of the selection is still a reference. (In Applescript, differentiating between references and the values of those references is taken care of automatically. Not so in appscript, which is why there&#8217;s get() and its kin in appscript in the first place).</p>
<p>Secondly, <code style="white-space:pre">.get(resulttype=</code>. get() (and all three variations) can take some specific &#8220;labeled parameters&#8221; (more technically called keyword arguments in Python, which is what I&#8217;ll use from now on)</p>
<ul>
<li><code>resulttype</code>: the type of data you want returned from the expression: (synonymous to Applescript&#8217;s &#8220;as &#8230;.&#8221; expression)</li>
<li><code>timeout</code>: the number of seconds to wait until the command times out (synonymous to Applescript&#8217;s &#8220;with timeout of &#8230; seconds clause.)</li>
<li><code>waitreply</code>: a boolean if appscript should wait around for a result, or just return right after a command is issued to the app (synonymous to Applescript&#8217;s &#8220;ignoring application responses&#8221; clause)</li>
</ul>
<p>If you wanted to go crazy, you could:<br />
<code style="white-space:pre">item1Alias = sel[0].get(resulttype=k.alias, timeout=1)  #get item 1 as alias in 1 second or timeout</code></p>
<p>Thirdly, and lastly: <code style="white-space:pre">k.alias)</code>. The <code>k</code> is appscript&#8217;s &#8220;keyword&#8221; namespace&#8230; where all the &#8220;keywords&#8221; live. (I disagree with this description a little: really it contains syntax for all the possible <em>types</em> you could need, not keywords, but it&#8217;s named how it&#8217;s named.)</p>
<p>If you&#8217;ve installed appscript on your machine, description of this namespace (and some common types) is found in <a href="file://localhost/Developer/Python/appscript/Documentation/appscript/06_classesandenums.html">Chapter 6 of Appscript&#8217;s documentation</a>. The rule with the more recent versions of appscript is that it&#8217;s of the form <code>k.type</code>, instead of older versions&#8217; <code>k.Type</code>.</p>
<p>Disclaimer: I&#8217;m reasonably sure the syntax (like the names of the keyword arguments for <code>get()</code>, and &#8220;k.type vs k.Type&#8221;) is still correct with the most recent versions of appscript. This is one part of appscript&#8217;s syntax that has seen a lot of change in the past. I&#8217;m using appscript 0.18.1. Your version of appscript can be easily found out by opening an interactive Python session (aka: typing <code>python</code> on the command line) and going:<br />
<code style="white-space:pre"><br />
Python 2.5 (r25:51918, Sep 19 2006, 08:49:13)<br />
....<br />
>>> import appscript<br />
>>> print appscript.__version__<br />
'0.18.1'<br />
</code>
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.wilcoxd.com/blog/appscripts-get-syntax-advanced-concepts.html/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Turn any shell script into a double-clickable app!</title>
		<link>http://www.wilcoxd.com/blog/turn-any-shell-script-into-a-double-clickable-app.html</link>
		<comments>http://www.wilcoxd.com/blog/turn-any-shell-script-into-a-double-clickable-app.html#comments</comments>
		<pubDate>Fri, 28 Dec 2007 05:37:19 +0000</pubDate>
		<dc:creator>Ryan Wilcox</dc:creator>
		
	<category>ResearchAndDevelopment</category>
		<guid isPermaLink="false">http://www.wilcoxd.com/blog/turn-any-shell-script-into-a-double-clickable-app.html</guid>
		<description><![CDATA[So, while this might be very obvious to other people, I found out an interesting thing about bundles today. In short, if you configure your Info.plist correctly, and have the right permissions for everything, it doesn&#8217;t matter what you put as you executable.
For example, I have a shell script I want to send someone, but [...]]]></description>
			<content:encoded><![CDATA[<p>So, while this might be very obvious to other people, I found out an interesting thing about bundles today. In short, if you configure your Info.plist correctly, and have the right permissions for everything, it doesn&#8217;t matter <strong>what</strong> you put as you executable.</p>
<p>For example, I have a shell script I want to send someone, but they aren&#8217;t computer savvy, so I want it to be a double-clickable app. How do I do this? There are a few tools that help you here: <a href="http://www.bluem.net/downloads/pashua_en/">Pashua</a> can give your script a GUI, and can also encase it as a stand-alone app. (&#8217;Cept I don&#8217;t really need the GUI part, thank you). <a href="http://www.wsanchez.net/software/">DropScript</a> works, but only triggers the shell script when you drop a file onto the app (but I don&#8217;t want that either, in my situation).</p>
<p>Looking at Pashua&#8217;s stand-alone app, I had a thought, and here&#8217;s my method for making app an out of anything.</p>
<ol>
<li>Start with an empty app bundle.<br />
You can either build one yourself, or use the one that comes with Pashua&#8217;s Sample Stand-Alone app.
</li>
<li>Put your shell script into your bundle&#8217;s <code>Contents/MacOS/</code> folder. Make it executable. (For the user and group) with <code>chmod ug+x</code> in Terminal.</li>
<li>Modify Info.plist&#8217;s <code>CFBundleName</code> to be the name of your, well, app bundle. Also (and most importantly) modify <code>CFBundleExecutable</code> to be the name of your shell script from step #2.</li>
<li>Double-click you app: your script should have run!</li>
</ol>
<p>Sadly, if something goes wrong, the system won&#8217;t tell you anything. Not a thing. (It&#8217;ll just do a half-bounce of the app in the Dock. Or say that the app bundle is damaged.) So you just have to troubleshoot it on your own. Good Luck there.</p>
<p>This shell script of course assumes that all your script needs is right installed on the user&#8217;s system. Which might be right in controlled situations. But for (say) Python (or PyObjC) applications, you really should be building with <a href="http://svn.pythonmac.org/py2app/py2app/trunk/doc/index.html">py2app</a>, which bundles up everything the script needs into the app, giving you a stand-alone solution that doesn&#8217;t even require that the user have Python (or have the right version of it).
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.wilcoxd.com/blog/turn-any-shell-script-into-a-double-clickable-app.html/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Python, Properties and Future Class Changes</title>
		<link>http://www.wilcoxd.com/blog/python-properties-and-future-class-changes.html</link>
		<comments>http://www.wilcoxd.com/blog/python-properties-and-future-class-changes.html#comments</comments>
		<pubDate>Mon, 10 Dec 2007 16:26:08 +0000</pubDate>
		<dc:creator>Ryan Wilcox</dc:creator>
		
	<category>ResearchAndDevelopment</category>
		<guid isPermaLink="false">http://www.wilcoxd.com/blog/python-properties-and-future-class-changes.html</guid>
		<description><![CDATA[For a while now I&#8217;ve been thinking about class attributes in dynamically typed languages. I usually view these languages as &#8220;less than 50,000 line program languages&#8221;. For more lines than that I personally want the type safety and compile checks of a statically typed compiled language (like C++). Granted, a 50,000 line Python program would [...]]]></description>
			<content:encoded><![CDATA[<p>For a while now I&#8217;ve been thinking about class attributes in dynamically typed languages. I usually view these languages as &#8220;less than 50,000 line program languages&#8221;. For more lines than that I personally want the type safety and compile checks of a statically typed compiled language (like C++). Granted, a 50,000 line Python program would probably have as much functionality as a half million line C++ program, and with a full suite of unit tests the Python program may be just as reliable and resilient to change (if not more so) than a static compiler checking your work ala C++.</p>
<p>Anyway, because of this &#8220;small project&#8221; view, and increased experience, most of the time I don&#8217;t want to create boilerplate code in my dynamic language class&#8230; and accessor methods seem like just that. Ruby has a way around that with its <code>attr_reader</code>/<code>attr_writter</code>, but I do most of my scripting in Python.</p>
<p><ins>But let me add that in languages that lack the ability to retain the same client interface while completely changing the behavior: direct data access to a function call in this case, I&#8217;d still write boilerplate getters/setters. Like when I&#8217;m writing Applescript modules&#8230;. So you could say that Ruby/Python does encapsulation one better: you can change from accessing data to <em>calling a function</em> without knowing it.</ins></p>
<p>The other day I ran across blog post at <a href="http://codefork.com/blog/index.php/2007/12/05/pimping-pythons-property/">codefork.com that talks about Python&#8217;s take on encapsulation</a>. Python&#8217;s approach is very pragmatic: modify the members directly then when you need to - and only when you need to - use Python&#8217;s property keyword to make Python call a instance method instead of looking for a data member of that name.</p>
<p>Version 1 of your class could be:<br />
<code style="white-space: pre"><br />
class Person:<br />
    def __init__(self):<br />
        self.age = None<br />
jeff = Person()<br />
jeff.age = 5 # maturity<br />
</code></p>
<p>Version 2 could be:<br />
<code style="white-space: pre"><br />
class Person(object):<br />
    def __init__(self):<br />
        self._age = None<br />
    def get_age(self):<br />
        return self._age<br />
    def set_age(self, value):<br />
        self._age = value<br />
    def del_age(self):<br />
        del self._age<br />
    age = property(get_age, set_age, del_age)<br />
jeff = Person()<br />
jeff.age = 5<br />
</code></p>
<p>And the codefork article stops there. But there&#8217;s more&#8230;</p>
<p>Say we plan to deprecate something (the <code>age</code> property), but we want to give our callers time to adjust before we pull the rug out from under them. We take another Python feature to do this: <a href="http://wiki.python.org/moin/PythonDecorators">decorators</a>.</p>
<p>To keep this simple we&#8217;ll use the most simple decorator: there is a better version of this in the <a href="http://wiki.python.org/moin/PythonDecoratorLibrary">Decorator Library</a> (<a href="http://wiki.python.org/moin/PythonDecoratorLibrary#head-de01988728ccdec415708f10928cc6feb022e7bb">jump to it</a>)  </p>
<p>Version 3:<br />
<code style="white-space: pre"><br />
import warnings<br />
def deprecated(fObj):<br />
    warnings.warn("%s is depricated as of version 3. It will be removed completly for version 4" % (fObj.__name__), DeprecationWarning, stacklevel=3 )<br />
    return fObj<br />
class Person(object):<br />
    def __init__(self):<br />
        self._age = None<br />
    @deprecated<br />
    def get_age(self):<br />
        return self._age<br />
    @deprecated<br />
    def set_age(self, value):<br />
        self._age = value<br />
    @deprecated<br />
    def del_age(self):<br />
        del self._age<br />
    age = property(get_age, set_age, del_age)<br />
jeff = Person()<br />
jeff.age = 5<br />
</code></p>
<p><a href="http://docs.python.org/lib/warning-functions.html">warning.warn</a> generates a warning which either could be ignored by the program, sent to standard out, or raise an exception - depending on a value you pass to Python.</p>
<p>The decorator is called automatically by Python before the actual function is called. Think of it like manually calling deprecated();  jeff.get_age() - although its more technically <code>deprecated(jeff.get_age)</code>. </p>
<p>Normally decorators make one wonder &#8220;so why not just call the one function then the other function and avoid the extra language feature?&#8221; In cases like these, where changing client code isn&#8217;t an option, or if the function gets called automatically - an age = 5 will call set_age() - decorators make it easy to change stuff around <em>without anybody else knowing</em>.</p>
<p>So we&#8217;ve gone through the whole life of an attribute: creation/ &#8220;let&#8217;s get it working for now&#8221;; refinement/ &#8220;ok: this needs to happen differently, but lets not tear up everything to do it&#8221;; to death/ &#8220;ok, we have to remove this, there are better ways now&#8230; we need to announce that its going away so people avoid it&#8230; then we can pull life support&#8221;. We have a way to avoid the broilerplate of tradition encapsulation and also retaining complete control over the class&#8217; destiny - which is what encapsulation is about: preventing internal changes from affecting callers.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.wilcoxd.com/blog/python-properties-and-future-class-changes.html/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>PyObjC (2.0) + FSEvents</title>
		<link>http://www.wilcoxd.com/blog/pyobjc-20-fsevents.html</link>
		<comments>http://www.wilcoxd.com/blog/pyobjc-20-fsevents.html#comments</comments>
		<pubDate>Tue, 20 Nov 2007 15:59:52 +0000</pubDate>
		<dc:creator>Ryan Wilcox</dc:creator>
		
	<category>Uncategorized</category>
		<guid isPermaLink="false">http://www.wilcoxd.com/blog/pyobjc-20-fsevents.html</guid>
		<description><![CDATA[For the adventurous: there&#8217;s a sample on how to integrate PyObjC with FSEvents at /Developer/Examples/Python/PyObjC/FSEvents/watcher.py
Neato.
]]></description>
			<content:encoded><![CDATA[<p>For the adventurous: there&#8217;s a sample on how to integrate PyObjC with FSEvents at <code>/Developer/Examples/Python/PyObjC/FSEvents/watcher.py</code></p>
<p>Neato.</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.wilcoxd.com/blog/pyobjc-20-fsevents.html/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>appscript&#8217;s get syntax</title>
		<link>http://www.wilcoxd.com/blog/appscripts-get-syntax.html</link>
		<comments>http://www.wilcoxd.com/blog/appscripts-get-syntax.html#comments</comments>
		<pubDate>Wed, 31 Oct 2007 15:26:04 +0000</pubDate>
		<dc:creator>Ryan Wilcox</dc:creator>
		
	<category>General Information</category>
		<guid isPermaLink="false">http://www.wilcoxd.com/blog/appscripts-get-syntax.html</guid>
		<description><![CDATA[I use appscript - a Python module letting me talk to scriptable applications on the Mac - everywhere I can. It means I can write less in the verbose, cranky, sometimes read-only AppleScript.
Appscript is nice, but in earlier versions seemed very&#8230; verbose. Where AppleScript did all kinds of magic behind the scenes, appscript made you [...]]]></description>
			<content:encoded><![CDATA[<p>I use <a href="http://appscript.sf.net">appscript</a> - a Python module letting me talk to scriptable applications on the Mac - everywhere I can. It means I can write less in the verbose, cranky, sometimes read-only AppleScript.</p>
<p>Appscript is nice, but in earlier versions seemed very&#8230; verbose. Where AppleScript did all kinds of magic behind the scenes, appscript made you do a lot of that stuff yourself. </p>
<p>Today I was working on getting an <del>object&#8217;s</del> <ins>reference&#8217;s</ins> value from appscript. In Applescript this is easy:</p>
<p><code><br />
tell app "Microsoft Word" to get selection's selection start<br />
</code><br />
(Maybe Word isn&#8217;t the best example of this, but it&#8217;s what I&#8217;m working in now&#8230;)</p>
<p>In appscript I&#8217;ve always struggled with how to get and set values in appscript. Not today, since I&#8217;ve discovered there are three ways of doing it (shown here from the Python Interpreter, one of the great tools for appscript: piece together things line by line interactively!)</p>
<p><code style="white-space:pre"><br />
>>> msw = app("Microsoft Word")<br />
>>> msw.selection.selection_start.get()<br />
48<br />
>>> msw.selection.selection_start()<br />
48<br />
>>> msw.get( msw.selection.selection_start )<br />
48<br />
</code></p>
<p>The first get() call is the one I&#8217;ve been using since early in appscript&#8217;s development. Entire reference (the subject), than the verb. It&#8217;s very <a href="http://en.wikipedia.org/wiki/Object-oriented_programming">OOP</a> smelling, OBJECT then VERB. You see this everywhere, including Python.</p>
<p>The second get() call is one I didn&#8217;t know about until I read the appscript manual just today: once you have a reference, call it like a function and you&#8217;ll get its value. That&#8217;s a great shortcut, and feels somewhat OOP too.</p>
<p>The third get() call is one I just discovered, and probably the most familiar to AppleScript programmers. Much of Applescript works on VERB then OBJECT, because it could be considered <a href="http://www.wilcoxd.com/blog/pyobjc.html#comment-8">not a class based object oriented programming language</a>. So here we are: GET the selection object&#8217;s selection start).</p>
<p>It&#8217;ll be a toss-up for me whither I&#8217;ll use the second or the third form of the &#8220;get idiom&#8221;, but I&#8217;ve always found the first to be too literal, personally. I&#8217;m glad there are other forms.</p>
<p>Oh, and PS: appscript has had addressing by creator code, bundle identifier, path, as well as name and eppc URL since very early in its development. Thanks for <a href="http://developer.apple.com/releasenotes/AppleScript/RN-AppleScript/index.html#//apple_ref/doc/uid/TP40000982-DontLinkElementID_3">catching up</a>, Applescript. &lt;nudge /&gt;
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.wilcoxd.com/blog/appscripts-get-syntax.html/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Betas and Testing</title>
		<link>http://www.wilcoxd.com/blog/betas-and-testing.html</link>
		<comments>http://www.wilcoxd.com/blog/betas-and-testing.html#comments</comments>
		<pubDate>Wed, 17 Oct 2007 17:45:46 +0000</pubDate>
		<dc:creator>Ryan Wilcox</dc:creator>
		
	<category>General Information</category>
		<guid isPermaLink="false">http://www.wilcoxd.com/blog/betas-and-testing.html</guid>
		<description><![CDATA[Steven Frank: Betas and Testing
Lots of truth in the article, from both ends (running a beta cycle, being in QA, and also giving some advice to people in a beta testing program. My advice for the latter group would be: test, let people know that you&#8217;re testing, even if you haven&#8217;t found any problems in [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://stevenf.com/2007/10/betas_and_testing.php">Steven Frank: Betas and Testing</a></p>
<p>Lots of truth in the article, from both ends (running a beta cycle, being in QA, and also giving some advice to people in a beta testing program. My advice for the latter group would be: test, let people know that you&#8217;re testing, even if you haven&#8217;t found any problems in the areas you&#8217;ve explored. Basically, let the people running the beta cycle that you&#8217;ve gone fishing in this part of the application and haven&#8217;t caught anything.)</p>
<p>But I have to point this out:</p>
<blockquote><p>
I&#8217;ve researched automated testing with products like Eggplant, with mixed results. I&#8217;m a big advocate of unit testing, but in practice, it always seems to get back-burnered, and is not easy enough to do with predominantly GUI-driven applications.
</p></blockquote>
<p>You can have all the unit tests in the world, but if the logic connecting your view component to everything else doesn&#8217;t work, the program doesn&#8217;t work. I know this point <a href="http://www.wilcoxd.com/blog/why-qa-testing-is-still-important-with-unit-tests.html">all too well</a>. So testing (internal QA and beta testing) are very useful. </p>
<p>The beta testing being a check on internal QA: making sure the internal QA does its job well, and also going above internal QA, trying oddball stuff that internal QA wouldn&#8217;t think of. When you work with a product day in and day out it&#8217;s easy to test and use the app only the way that makes sense to you - or to the development group - but people may use the app differently in the real world. People will zig when you are expecting them to zag. Which is also why you need beta testers, even if you have automated tests.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.wilcoxd.com/blog/betas-and-testing.html/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Google CTemplate Integration (Check!)</title>
		<link>http://www.wilcoxd.com/blog/google-ctemplate-integration-check.html</link>
		<comments>http://www.wilcoxd.com/blog/google-ctemplate-integration-check.html#comments</comments>
		<pubDate>Tue, 21 Aug 2007 21:39:13 +0000</pubDate>
		<dc:creator>Ryan Wilcox</dc:creator>
		
	<category>Distribute</category>
		<guid isPermaLink="false">http://www.wilcoxd.com/blog/google-ctemplate-integration-check.html</guid>
		<description><![CDATA[Today I tried out Google CTemplate, as I said I would. In addition to what I liked about the template language, it has tools to check your templates and generate C constants for the template elements (aka: the things to replace in the template). Meaning (if you use those constants) you can change the name [...]]]></description>
			<content:encoded><![CDATA[<p>Today I tried out <a href="http://code.google.com/p/google-ctemplate/">Google CTemplate</a>, as <a href="http://www.wilcoxd.com/blog/shifting-gears.html">I said I would</a>. In addition to what I liked about the template language, it has tools to check your templates and generate C constants for the template elements (aka: the things to replace in the template). Meaning (if you use those constants) you can change the name of things in your template and your C++ code will complain, catching the errors at compile time instead of runtime.</p>
<p>I&#8217;ve integrated these tools into the build script so we have this safety from the get go.</p>
<p>I also have very comprehensive instructions for building the project, between gathering up all the tools to build on my <a href="http://www.wilcoxd.com/blog/back-to-full-capacity.html">functional machine</a>, and fighting through all the build/linker errors I&#8217;ve been faced with.</p>
<p>So today my research app builds again. It&#8217;s a good day (and about time).
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.wilcoxd.com/blog/google-ctemplate-integration-check.html/feed/</wfw:commentRSS>
		</item>
	</channel>
</rss>
