<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    <title>WaveSpace - Software</title>
    <link>http://wavespace.info/</link>
    <description>Guy Mac's Personal Blog</description>
    <dc:language>en</dc:language>
    <generator>Serendipity 1.0.3 - http://www.s9y.org/</generator>
    <pubDate>Thu, 30 Oct 2008 01:43:45 GMT</pubDate>

    <image>
        <url>http://wavespace.info/templates/default/img/s9y_banner_small.png</url>
        <title>RSS: WaveSpace - Software - Guy Mac's Personal Blog</title>
        <link>http://wavespace.info/</link>
        <width>100</width>
        <height>21</height>
    </image>

<item>
    <title>There Is Only XUL</title>
    <link>http://wavespace.info/archives/288-There-Is-Only-XUL.html</link>
            <category>Software</category>
    
    <comments>http://wavespace.info/archives/288-There-Is-Only-XUL.html#comments</comments>
    <wfw:comment>http://wavespace.info/wfwcomment.php?cid=288</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://wavespace.info/rss.php?version=2.0&amp;type=comments&amp;cid=288</wfw:commentRss>
    

    <author>nospam@example.com (Guy McArthur)</author>
    <content:encoded>
    &lt;p&gt;&lt;a href=&quot;https://developer.mozilla.org/en/XUL_Reference&quot;&gt;XUL&lt;/a&gt; is an application framework from Mozilla (Firefox and Thunderbird are XUL applications with C++ extensions). I recently learned that you can &lt;a href=&quot;http://developer.mozilla.org/En/Code_snippets:Running_applications&quot;&gt;run command-line programs&lt;/a&gt; from within script sections of XUL, which makes it significantly more useful for me. Of course, there are security restrictions; the XUL file needs to load from a local file (or be signed).
&lt;/p&gt;
&lt;p&gt;What I really like about it is that the UI is declarative, you can just type it up, preview it in the browser and hit reload to see changes. With the error console and other developer tools, you can use the same development tools and techniques from the web. Add the flexibility of JavaScript and you&#039;ve got a really powerful base. There are some issues with particular 3rd party JavaScript libraries (such as jQuery), but it&#039;s not a big stumbling block.
&lt;/p&gt;
&lt;p&gt;Here is a toy application, yet another Twitter client. You&#039;d run it with (for instance) &lt;tt&gt;firefox -chrome test.xul&lt;/tt&gt;. If it executed commands, it would need a line that said &lt;tt&gt;netscape.security.PrivilegeManager.enablePrivilege (&quot;UniversalXPConnect&quot;);&lt;/tt&gt; (the example does output with AJAX instead).&lt;/p&gt;
&lt;pre&gt;
&lt;span style=&quot;font-weight: bold;color: #000000;&quot;&gt;&amp;lt;?xml&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; version=&quot;1.0&quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold;color: #000000;&quot;&gt;?&amp;gt;&lt;/span&gt;
&lt;span style=&quot;font-weight: bold;color: #000000;&quot;&gt;&amp;lt;?xml-stylesheet&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; href=&quot;chrome://global/skin/&quot; type=&quot;text/css&quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold;color: #000000;&quot;&gt;?&amp;gt;&lt;/span&gt;

&lt;span style=&quot;font-style: italic;color: #808080;&quot;&gt;&amp;lt;!--&lt;/span&gt;

&lt;span style=&quot;font-style: italic;color: #808080;&quot;&gt;    Twitter updater implemented in XUL&lt;/span&gt;

&lt;span style=&quot;font-style: italic;color: #808080;&quot;&gt;--&amp;gt;&lt;/span&gt;
&lt;span style=&quot;font-weight: bold;color: #000000;&quot;&gt;&amp;lt;window&lt;/span&gt;
&lt;span style=&quot;color: #008000;&quot;&gt;    id=&lt;/span&gt;&lt;span style=&quot;color: #aa0000;&quot;&gt;&quot;win&quot;&lt;/span&gt;
&lt;span style=&quot;color: #008000;&quot;&gt;    title=&lt;/span&gt;&lt;span style=&quot;color: #aa0000;&quot;&gt;&quot;XUL Twitter&quot;&lt;/span&gt;
&lt;span style=&quot;color: #008000;&quot;&gt;    orient=&lt;/span&gt;&lt;span style=&quot;color: #aa0000;&quot;&gt;&quot;vertical&quot;&lt;/span&gt;
&lt;span style=&quot;color: #008000;&quot;&gt;    xmlns=&lt;/span&gt;&lt;span style=&quot;color: #aa0000;&quot;&gt;&quot;http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul&quot;&lt;/span&gt;
&lt;span style=&quot;color: #008000;&quot;&gt;    onload=&lt;/span&gt;&lt;span style=&quot;color: #aa0000;&quot;&gt;&quot;updateLabel()&quot;&lt;/span&gt;
&lt;span style=&quot;font-weight: bold;color: #000000;&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;font-weight: bold;color: #000000;&quot;&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;font-weight: bold;color: #000000;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; max = &lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;140&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;font-weight: bold;color: #000000;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; uid = &lt;/span&gt;&lt;span style=&quot;color: #dd0000;&quot;&gt;&#039;&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;guymac&#039;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;font-weight: bold;color: #000000;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; pwd = &lt;/span&gt;&lt;span style=&quot;color: #dd0000;&quot;&gt;&#039;&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;******&#039;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;;&lt;/span&gt;

&lt;span style=&quot;color: #000000;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;font-weight: bold;color: #000000;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; twitUpdate = &lt;/span&gt;&lt;span style=&quot;color: #dd0000;&quot;&gt;&#039;&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;http://twitter.com/statuses/update.xml&#039;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;font-weight: bold;color: #000000;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; twitCloser = &lt;/span&gt;&lt;span style=&quot;color: #dd0000;&quot;&gt;&#039;&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;http://twitter.com/account/end_session&#039;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;;&lt;/span&gt;

&lt;span style=&quot;color: #000000;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;font-weight: bold;color: #000000;&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; updateLabel()&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;        {&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;font-weight: bold;color: #000000;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; lbl = &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;document&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;.getElementById(&lt;/span&gt;&lt;span style=&quot;color: #dd0000;&quot;&gt;&#039;&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;lbl&#039;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;);&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;font-weight: bold;color: #000000;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; txt = &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;document&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;.getElementById(&lt;/span&gt;&lt;span style=&quot;color: #dd0000;&quot;&gt;&#039;&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;txt&#039;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;);&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;font-weight: bold;color: #000000;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; rem = max - txt.textLength;&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;            lbl.textContent = rem + &lt;/span&gt;&lt;span style=&quot;color: #dd0000;&quot;&gt;&#039;&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt; char&#039;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; + (rem &amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; ? &lt;/span&gt;&lt;span style=&quot;color: #dd0000;&quot;&gt;&#039;&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;s&#039;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; : &lt;/span&gt;&lt;span style=&quot;color: #dd0000;&quot;&gt;&#039;&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;&#039;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; ) + &lt;/span&gt;&lt;span style=&quot;color: #dd0000;&quot;&gt;&#039;&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt; remaining&#039;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;            txt.disabled = !(rem &amp;gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;);&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;        }&lt;/span&gt;

&lt;span style=&quot;color: #000000;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;font-weight: bold;color: #000000;&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; postTweet()&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;        {&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;font-weight: bold;color: #000000;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; lbl = &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;document&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;.getElementById(&lt;/span&gt;&lt;span style=&quot;color: #dd0000;&quot;&gt;&#039;&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;lbl&#039;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;);&lt;/span&gt;

&lt;span style=&quot;color: #000000;&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;font-weight: bold;color: #000000;&quot;&gt;try&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;            {&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;                &lt;/span&gt;&lt;span style=&quot;font-weight: bold;color: #000000;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; req = &lt;/span&gt;&lt;span style=&quot;font-weight: bold;color: #000000;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; XMLHttpRequest();&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;                req.&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;open&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #dd0000;&quot;&gt;&quot;POST&quot;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;, twitUpdate, &lt;/span&gt;&lt;span style=&quot;font-weight: bold;color: #000000;&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;, uid, pwd);&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;                req.setRequestHeader(&lt;/span&gt;&lt;span style=&quot;color: #dd0000;&quot;&gt;&#039;&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;Content-Type&#039;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #dd0000;&quot;&gt;&#039;&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;application/x-www-form-urlencoded&#039;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;);&lt;/span&gt;

&lt;span style=&quot;color: #000000;&quot;&gt;                req.send(&lt;/span&gt;&lt;span style=&quot;color: #dd0000;&quot;&gt;&#039;&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;status=&#039;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; + &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;document&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;.getElementById(&lt;/span&gt;&lt;span style=&quot;color: #dd0000;&quot;&gt;&#039;&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;txt&#039;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;).&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;);&lt;/span&gt;

&lt;span style=&quot;color: #000000;&quot;&gt;                &lt;/span&gt;&lt;span style=&quot;font-weight: bold;color: #000000;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; (req.&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;status&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; != &lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;200&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;font-weight: bold;color: #000000;&quot;&gt;throw&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; req.statusText;&lt;/span&gt;

&lt;span style=&quot;color: #000000;&quot;&gt;                lbl.textContent = &lt;/span&gt;&lt;span style=&quot;color: #dd0000;&quot;&gt;&#039;&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;Twitter Updated!&#039;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;            }&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;font-weight: bold;color: #000000;&quot;&gt;catch&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; (ex)&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;            {&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;                lbl.textContent = &lt;/span&gt;&lt;span style=&quot;color: #dd0000;&quot;&gt;&#039;&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;Update failed (&#039;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; + ex + &lt;/span&gt;&lt;span style=&quot;color: #dd0000;&quot;&gt;&#039;&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;)&#039;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;; &lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;            }&lt;/span&gt;

&lt;span style=&quot;color: #000000;&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;font-weight: bold;color: #000000;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;  req = &lt;/span&gt;&lt;span style=&quot;font-weight: bold;color: #000000;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; XMLHttpRequest();&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;            req.&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;open&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #dd0000;&quot;&gt;&quot;GET&quot;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;, twitCloser, &lt;/span&gt;&lt;span style=&quot;font-weight: bold;color: #000000;&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;, uid, pwd);&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;            req.send(null);&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;        }&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;font-weight: bold;color: #000000;&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;

&lt;span style=&quot;color: #000000;&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;font-weight: bold;color: #000000;&quot;&gt;&amp;lt;textbox&lt;/span&gt;
&lt;span style=&quot;color: #008000;&quot;&gt;        id=&lt;/span&gt;&lt;span style=&quot;color: #aa0000;&quot;&gt;&quot;txt&quot;&lt;/span&gt;
&lt;span style=&quot;color: #008000;&quot;&gt;        maxlength=&lt;/span&gt;&lt;span style=&quot;color: #aa0000;&quot;&gt;&quot;140&quot;&lt;/span&gt;
&lt;span style=&quot;color: #008000;&quot;&gt;        size=&lt;/span&gt;&lt;span style=&quot;color: #aa0000;&quot;&gt;&quot;140&quot;&lt;/span&gt;
&lt;span style=&quot;color: #008000;&quot;&gt;        multiline=&lt;/span&gt;&lt;span style=&quot;color: #aa0000;&quot;&gt;&quot;true&quot;&lt;/span&gt;
&lt;span style=&quot;color: #008000;&quot;&gt;        oninput=&lt;/span&gt;&lt;span style=&quot;color: #aa0000;&quot;&gt;&quot;updateLabel()&quot;&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;font-weight: bold;color: #000000;&quot;&gt;/&amp;gt;&lt;/span&gt;

&lt;span style=&quot;color: #000000;&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;font-weight: bold;color: #000000;&quot;&gt;&amp;lt;label&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt; id=&lt;/span&gt;&lt;span style=&quot;color: #aa0000;&quot;&gt;&quot;lbl&quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold;color: #000000;&quot;&gt;/&amp;gt;&lt;/span&gt;

&lt;span style=&quot;color: #000000;&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;font-weight: bold;color: #000000;&quot;&gt;&amp;lt;hbox&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;font-weight: bold;color: #000000;&quot;&gt;&amp;lt;button&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt; label=&lt;/span&gt;&lt;span style=&quot;color: #aa0000;&quot;&gt;&quot;Post&quot;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt; oncommand=&lt;/span&gt;&lt;span style=&quot;color: #aa0000;&quot;&gt;&quot;postTweet()&quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold;color: #000000;&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;font-weight: bold;color: #000000;&quot;&gt;&amp;lt;button&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt; label=&lt;/span&gt;&lt;span style=&quot;color: #aa0000;&quot;&gt;&quot;Close&quot;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt; oncommand=&lt;/span&gt;&lt;span style=&quot;color: #aa0000;&quot;&gt;&quot;window.close()&quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold;color: #000000;&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;font-weight: bold;color: #000000;&quot;&gt;&amp;lt;/hbox&amp;gt;&lt;/span&gt;

&lt;span style=&quot;font-weight: bold;color: #000000;&quot;&gt;&amp;lt;/window&amp;gt;&lt;/span&gt;
&lt;/pre&gt; 
    </content:encoded>

    <pubDate>Wed, 29 Oct 2008 21:43:45 -0400</pubDate>
    <guid isPermaLink="false">http://wavespace.info/archives/288-guid.html</guid>
    
</item>
<item>
    <title>A Python Twitter Widget</title>
    <link>http://wavespace.info/archives/271-A-Python-Twitter-Widget.html</link>
            <category>Software</category>
    
    <comments>http://wavespace.info/archives/271-A-Python-Twitter-Widget.html#comments</comments>
    <wfw:comment>http://wavespace.info/wfwcomment.php?cid=271</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://wavespace.info/rss.php?version=2.0&amp;type=comments&amp;cid=271</wfw:commentRss>
    

    <author>nospam@example.com (Guy McArthur)</author>
    <content:encoded>
    &lt;p&gt;A few weeks back, I posted a couple of &lt;a href=&quot;http://wavespace.info/archives/257-GUI-Shell-Scripts.html&quot;&gt;examples&lt;/a&gt; of trivial (but graphical) Twitter clients. Here&#039;s a slightly more featured example, which uses the PyQt library to hook into the powerful cross-platform &lt;a href=&quot;http://doc.trolltech.com/4.0/&quot;&gt;Qt&lt;/a&gt; toolkit from Python.
&lt;/p&gt;
&lt;img alt=&quot;PyQt4 Twitter Client&quot; src=&quot;http://wavespace.info/images/ptwitter.png&quot; style=&quot;align:left&quot;/&gt;
&lt;p&gt;Here&#039;s a screenshot. It shows how many characters you have remaining, and disables posting if the character count is over the limit. Below is the code. To run on a Debian system you&#039;d install the &lt;tt&gt;python-qt4&lt;/tt&gt; and &lt;tt&gt;python-httplib2&lt;/tt&gt; packages. I think it is a good example that for simple applications, the Python-Qt framework is pretty nice, though in lines of code, it would probably be about the same in Java (and probably less in JavaFX). Another nice thing is that you can put together the UI with &lt;a href=&quot;http://trolltech.com/products/qt/features/tools/designer&quot;&gt;Qt Designer&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;Zetcode&#039;s &lt;a href=&quot;http://zetcode.com/tutorials/pyqt4/&quot;&gt;PyQt4 tutorial&lt;/a&gt; and the official &lt;a href=&quot;http://www.riverbankcomputing.com/software/pyqt/intro&quot;&gt;PyQt documentation&lt;/a&gt; were indispensable.
&lt;/p&gt;
&lt;pre&gt;
&lt;span style=&quot;font-style: italic;color: #808080;&quot;&gt;#!/usr/bin/python&lt;/span&gt;

&lt;span style=&quot;color: #ff00ff;&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; sys, urllib, httplib2&lt;/span&gt;
&lt;span style=&quot;color: #ff00ff;&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; PyQt4 &lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; QtCore, QtGui&lt;/span&gt;

&lt;span style=&quot;font-weight: bold;color: #000000;&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; PTwitter&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;QtGui.QWidget&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;):&lt;/span&gt;

&lt;span style=&quot;color: #000000;&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;max&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;140&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;    uid &lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #dd0000;&quot;&gt;&#039;guymac&#039;&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;    pwd &lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #dd0000;&quot;&gt;&#039;********&#039;&lt;/span&gt;

&lt;span style=&quot;color: #000000;&quot;&gt;    twitUpdate &lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #dd0000;&quot;&gt;&#039;http://twitter.com/statuses/update.xml&#039;&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;    twitCloser &lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #dd0000;&quot;&gt;&#039;http://twitter.com/account/end_session&#039;&lt;/span&gt;

&lt;span style=&quot;color: #000000;&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;font-weight: bold;color: #000000;&quot;&gt;def&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; postTweet&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;):&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;        mesg &lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;.txt.toPlainText&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;()&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;        post &lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; urllib.urlencode&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;({&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #dd0000;&quot;&gt;&#039;status&#039;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; mesg &lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;})&lt;/span&gt;

&lt;span style=&quot;color: #000000;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;font-weight: bold;color: #000000;&quot;&gt;try&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;:&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;            http &lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; httplib2.Http&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;()&lt;/span&gt;

&lt;span style=&quot;color: #000000;&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;font-style: italic;color: #808080;&quot;&gt;# override the default (no exceptions, status in response)&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;            http.force_exception_to_status_code &lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;False&lt;/span&gt;

&lt;span style=&quot;color: #000000;&quot;&gt;            http.add_credentials&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;.uid, &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;.pwd&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;)&lt;/span&gt;

&lt;span style=&quot;color: #000000;&quot;&gt;            resp, content &lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; http.request&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;.twitUpdate, &lt;/span&gt;&lt;span style=&quot;color: #dd0000;&quot;&gt;&#039;POST&#039;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;, post&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;)&lt;/span&gt;

&lt;span style=&quot;color: #000000;&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;font-weight: bold;color: #000000;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; resp &lt;/span&gt;&lt;span style=&quot;font-weight: bold;color: #000000;&quot;&gt;and&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; resp.status &lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;==&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;200&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;:&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;                &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;.lbl.setText&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #dd0000;&quot;&gt;&#039;Twitter updated!&#039;&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;)&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;font-weight: bold;color: #000000;&quot;&gt;else&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;:&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;                &lt;/span&gt;&lt;span style=&quot;font-weight: bold;color: #000000;&quot;&gt;raise&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; httplib2.HttpLib2Error, &lt;/span&gt;&lt;span style=&quot;color: #dd0000;&quot;&gt;&#039;No response&#039;&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;font-weight: bold;color: #000000;&quot;&gt;except&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; httplib2.HttpLib2Error, ex&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;:&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;font-weight: bold;color: #000000;&quot;&gt;print&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; ex&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;.lbl.setText&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;ex.__str__&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;())&lt;/span&gt;

&lt;span style=&quot;color: #000000;&quot;&gt;        http.request&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;.twitCloser&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;)&lt;/span&gt;

&lt;span style=&quot;color: #000000;&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;font-weight: bold;color: #000000;&quot;&gt;def&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; updateLabel&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;):&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;len&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;.txt.toPlainText&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;()&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;.size&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;()&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;.lbl.setText&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #dd0000;&quot;&gt;&#039;&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;%d&lt;/span&gt;&lt;span style=&quot;color: #dd0000;&quot;&gt; char(s) remaining&#039;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;%&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;max&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;len&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;))&lt;/span&gt;

&lt;span style=&quot;color: #000000;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;font-style: italic;color: #808080;&quot;&gt;# disable the post button if chars &amp;gt; max&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;.pb1.setEnabled&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;len&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;&amp;lt;=&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;max&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;)&lt;/span&gt;

&lt;span style=&quot;color: #000000;&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;font-weight: bold;color: #000000;&quot;&gt;def&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; __init__&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;):&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;        QtGui.QWidget.__init__&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;)&lt;/span&gt;

&lt;span style=&quot;color: #000000;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;font-style: italic;color: #808080;&quot;&gt;# Button to post&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;.pb1 &lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; QtGui.QPushButton&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #dd0000;&quot;&gt;&#039;Post&#039;&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;)&lt;/span&gt;

&lt;span style=&quot;color: #000000;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;font-style: italic;color: #808080;&quot;&gt;# Button to close&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;.pb2 &lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; QtGui.QPushButton&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #dd0000;&quot;&gt;&#039;Close&#039;&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;)&lt;/span&gt;

&lt;span style=&quot;color: #000000;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;font-style: italic;color: #808080;&quot;&gt;# TextField for input&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;.txt &lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; QtGui.QTextEdit&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;()&lt;/span&gt;

&lt;span style=&quot;color: #000000;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;font-style: italic;color: #808080;&quot;&gt;# Label to show characters remaining&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;.lbl &lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; QtGui.QLabel&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;()&lt;/span&gt;

&lt;span style=&quot;color: #000000;&quot;&gt;        tab &lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; QtGui.QGridLayout&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;()&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;        tab.setSpacing&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;5&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;)&lt;/span&gt;

&lt;span style=&quot;color: #000000;&quot;&gt;        tab.addWidget&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;.txt, &lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;)&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;        tab.addWidget&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;.lbl, &lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;)&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;        tab.addWidget&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;.pb1, &lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;)&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;        tab.addWidget&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;.pb2, &lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;)&lt;/span&gt;

&lt;span style=&quot;color: #000000;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;.setLayout&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;tab&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;)&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;.setWindowTitle&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #dd0000;&quot;&gt;&#039;PyQt4 Twitter&#039;&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;)&lt;/span&gt;

&lt;span style=&quot;color: #000000;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;.updateLabel&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;()&lt;/span&gt;

&lt;span style=&quot;color: #000000;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;font-style: italic;color: #808080;&quot;&gt;# connect text change to number of chars message&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;.connect&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;.txt, QtCore.SIGNAL&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #dd0000;&quot;&gt;&#039;textChanged()&#039;&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;,&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;.updateLabel&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;)&lt;/span&gt;

&lt;span style=&quot;color: #000000;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;font-style: italic;color: #808080;&quot;&gt;# connect post click to send message&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;.connect&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;.pb1, QtCore.SIGNAL&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #dd0000;&quot;&gt;&#039;clicked()&#039;&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;,&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;.postTweet&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;)&lt;/span&gt;

&lt;span style=&quot;color: #000000;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;font-style: italic;color: #808080;&quot;&gt;# connect close click to quit&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;.connect&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;.pb2, QtCore.SIGNAL&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #dd0000;&quot;&gt;&#039;clicked()&#039;&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;,&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;            QtGui.qApp, QtCore.SLOT&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #dd0000;&quot;&gt;&#039;quit()&#039;&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;))&lt;/span&gt;

&lt;span style=&quot;font-style: italic;color: #808080;&quot;&gt;# application&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;app &lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; QtGui.QApplication&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;sys.argv&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;)&lt;/span&gt;

&lt;span style=&quot;font-style: italic;color: #808080;&quot;&gt;# window&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;win &lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; PTwitter&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;()&lt;/span&gt;

&lt;span style=&quot;font-style: italic;color: #808080;&quot;&gt;# display&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;win.show&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;()&lt;/span&gt;

&lt;span style=&quot;font-style: italic;color: #808080;&quot;&gt;# execute&lt;/span&gt;
&lt;span style=&quot;color: #000000;&quot;&gt;sys.&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;exit&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;app.exec_&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;())&lt;/span&gt;
&lt;/pre&gt; 
    </content:encoded>

    <pubDate>Thu, 04 Sep 2008 00:12:04 -0400</pubDate>
    <guid isPermaLink="false">http://wavespace.info/archives/271-guid.html</guid>
    
</item>
<item>
    <title>Python and the Python Cookbook</title>
    <link>http://wavespace.info/archives/269-Python-and-the-Python-Cookbook.html</link>
            <category>Software</category>
    
    <comments>http://wavespace.info/archives/269-Python-and-the-Python-Cookbook.html#comments</comments>
    <wfw:comment>http://wavespace.info/wfwcomment.php?cid=269</wfw:comment>

    <slash:comments>12</slash:comments>
    <wfw:commentRss>http://wavespace.info/rss.php?version=2.0&amp;type=comments&amp;cid=269</wfw:commentRss>
    

    <author>nospam@example.com (Guy McArthur)</author>
    <content:encoded>
    &lt;p&gt;I&#039;m disappointed with O&#039;Reilly&#039;s &lt;a href=&quot;http://oreilly.com/catalog/9780596007973/&quot;&gt;&lt;i&gt;Python Cookbook (Second Edition)&lt;/i&gt;&lt;/a&gt;. It&#039;s unfortunate because I&#039;ve found their &quot;Cookbooks&quot; for other languages to be A) a good way to pick up the fundamentals while B) learn recipes for common programming tasks. The Python Cookbook skimps on the language fundamentals while, despite its huge bulk, having few recipes for task types that I can imagine needing to know.
&lt;/p&gt;
&lt;p&gt;For instance, there are no examples of an XPath API, which I&#039;d consider indispensable. One of the first things I wanted to do was take the Netflix Queue XHTML and simply extract the titles. I dug up &lt;a href=&quot;http://www.jroller.com/guymac/date/20041005&quot;&gt;some old Java code&lt;/a&gt; to do it.
&lt;/p&gt;
&lt;p&gt;The chapter on XML doesn&#039;t even have any examples of creating XML! And every Python example I&#039;ve seen so far does it by simply spitting out strings. Where are the equivalents of StAX, DOM, JDOM, or (wishful thinking) E4X?
&lt;/p&gt;
&lt;p&gt;I appreciate Python&#039;s attempt to be clean, consistent, and object-oriented... in marked contrast to Perl&#039;s hodge-podge gumbo of pre-OOP stuff like C, Bourne shell, and so on. But the OOP chapter is just bizarre, full of things that I&#039;ve never needed to worry about in Java.
&lt;/p&gt;
&lt;p&gt;The chapters on network and web programming don&#039;t show how to post to a web server or do authentication. The online &lt;a href=&quot;http://docs.python.org/lib/lib.html&quot;&gt;library reference&lt;/a&gt; is useful, but very short on complete examples. I could go on, but suffice it to say that without Google searches, I wouldn&#039;t have gotten very far with Python.
&lt;/p&gt; 
    </content:encoded>

    <pubDate>Wed, 03 Sep 2008 23:04:33 -0400</pubDate>
    <guid isPermaLink="false">http://wavespace.info/archives/269-guid.html</guid>
    
</item>
<item>
    <title>What A Twit!</title>
    <link>http://wavespace.info/archives/265-What-A-Twit!.html</link>
            <category>Software</category>
    
    <comments>http://wavespace.info/archives/265-What-A-Twit!.html#comments</comments>
    <wfw:comment>http://wavespace.info/wfwcomment.php?cid=265</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://wavespace.info/rss.php?version=2.0&amp;type=comments&amp;cid=265</wfw:commentRss>
    

    <author>nospam@example.com (Guy McArthur)</author>
    <content:encoded>
    &lt;p&gt;So I figured out a &lt;a href=&quot;http://twitter.com/guymac&quot;&gt;reason to use twitter&lt;/a&gt;. No, not publishing random thoughts--anything worth a tweet is too infrequent. And not describing my daily whereabouts--there&#039;s little utility in that. What I&#039;m doing instead is a fitness activity log. Not that anyone will care, but it does a) provide me a log which is useful for training and b) give some extra motivation vis-&amp;#224;-vis the mere possibility that my friends and co-workers might check it out.
&lt;/p&gt; 
    </content:encoded>

    <pubDate>Sat, 02 Aug 2008 03:09:18 -0400</pubDate>
    <guid isPermaLink="false">http://wavespace.info/archives/265-guid.html</guid>
    
</item>
<item>
    <title>GUI Shell Scripts</title>
    <link>http://wavespace.info/archives/257-GUI-Shell-Scripts.html</link>
            <category>Software</category>
    
    <comments>http://wavespace.info/archives/257-GUI-Shell-Scripts.html#comments</comments>
    <wfw:comment>http://wavespace.info/wfwcomment.php?cid=257</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://wavespace.info/rss.php?version=2.0&amp;type=comments&amp;cid=257</wfw:commentRss>
    

    <author>nospam@example.com (Guy McArthur)</author>
    <content:encoded>
    &lt;p&gt;Hook graphical widgets to shell scripts and you have a powerful but under-utilized class of applications. Systems programmers are typically writing code that does not need user interaction. Software developers are typically writing larger-scale programs in languages with rich widget libraries. But the domain in between does have some important uses, for instance small-scale programs that need input from non-technical operators, or need to alert them as tasks succeed (or fail).
&lt;/p&gt;
&lt;p&gt;I was reminded of this the other day when looking for a really simple &lt;a href=&quot;http://twitter.com/&quot;&gt;Twitter&lt;/a&gt; client, just something I could click from the desktop or taskbar, input a string of text and be done. The one I found was a single-line shell script that used &lt;a href=&quot;http://techbase.kde.org/Development/Tutorials/Shell_Scripting_with_KDE_Dialogs&quot;&gt;kdialog&lt;/a&gt;. I added a line to catch errors. Here is the complete script.
&lt;/p&gt;
&lt;p&gt;&lt;tt&gt;
&lt;span style=&quot;font-style: italic;color: #808080;&quot;&gt;#!/bin/bash&lt;/span&gt;&lt;br/&gt;

&lt;span style=&quot;color: #000000;&quot;&gt;curl -u username:password -s -F &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;status=&lt;/span&gt;&lt;span style=&quot;color: #dd0000;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold;color: #000000;&quot;&gt;`&lt;/span&gt;&lt;span style=&quot;font-weight: bold;color: #cc00cc;&quot;&gt;kdialog&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; --inputbox &lt;/span&gt;&lt;span style=&quot;color: #dd0000;&quot;&gt;&#039;what are you doing right now?&#039;&lt;/span&gt;&lt;span style=&quot;font-weight: bold;color: #000000;&quot;&gt;`&lt;/span&gt;&lt;span style=&quot;color: #dd0000;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; http://twitter.com/statuses/update.xml http://twitter.com/account/end_session&lt;/span&gt;&lt;br/&gt;

&lt;span style=&quot;font-weight: bold;color: #000000;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;font-weight: bold;color: #880088;&quot;&gt; [&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;$?&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; != 0&lt;/span&gt;&lt;span style=&quot;font-weight: bold;color: #880088;&quot;&gt; ]&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;font-weight: bold;color: #000000;&quot;&gt;then&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-weight: bold;color: #cc00cc;&quot;&gt;kdialog&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; --error &lt;/span&gt;&lt;span style=&quot;color: #dd0000;&quot;&gt;&#039;Twitter could not be updated&#039;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;font-weight: bold;color: #000000;&quot;&gt;fi&lt;/span&gt;
&lt;/tt&gt;
&lt;/p&gt;

&lt;p&gt;The next day I happened to read about a Python module that provides similar functionality for Mac OS X; it&#039;s called &lt;a href=&quot;http://www.oreillynet.com/onlamp/blog/2008/03/pymotw_easydialogs.html&quot;&gt;EasyDialogs&lt;/a&gt;. So I made a Mac version (my first real Python program). Here it is.
&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;
&lt;span style=&quot;font-style: italic;color: #808080;&quot;&gt;#!/usr/bin/pythonw&lt;/span&gt;&lt;br/&gt;

&lt;span style=&quot;color: #ff00ff;&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; EasyDialogs&lt;/span&gt;&lt;br/&gt;
&lt;span style=&quot;color: #ff00ff;&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; os&lt;/span&gt;&lt;br/&gt;

&lt;span style=&quot;color: #000000;&quot;&gt;ret &lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; os.system&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #dd0000;&quot;&gt;&#039;curl -u username:password -s -F status=&quot;&#039;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; EasyDialogs.AskString&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #dd0000;&quot;&gt;&#039;What are you doing right now?&#039;&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #dd0000;&quot;&gt;&#039;&quot; http://twitter.com/statuses/update.xml http://twitter.com/account/end_session&#039;&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;)&lt;/span&gt;&lt;br/&gt;

&lt;span style=&quot;font-weight: bold;color: #000000;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; ret&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;:&lt;/span&gt;&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style=&quot;color: #000000;&quot;&gt;    EasyDialogs.Message&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #dd0000;&quot;&gt;&#039;Twitter could not be updated.&#039;&lt;/span&gt;&lt;span style=&quot;color: #ff00ff;&quot;&gt;)&lt;/span&gt;
&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;Either can be made executable and linked from the dock/taskbar for quick launch. Check out the tutorials for &lt;a href=&quot;http://techbase.kde.org/Development/Tutorials/Shell_Scripting_with_KDE_Dialogs&quot;&gt;kdialog&lt;/a&gt; or &lt;a href=&quot;http://www.oreillynet.com/onlamp/blog/2008/03/pymotw_easydialogs.html&quot;&gt;EasyDialog&lt;/a&gt; for a better idea of what the possibilities are (complete with many graphical examples) using the standard widgets such as file choosers, checkboxes, etc.
&lt;/p&gt; 
    </content:encoded>

    <pubDate>Sun, 27 Jul 2008 04:08:00 -0400</pubDate>
    <guid isPermaLink="false">http://wavespace.info/archives/257-guid.html</guid>
    
</item>
<item>
    <title>The Hardy Heron</title>
    <link>http://wavespace.info/archives/250-The-Hardy-Heron.html</link>
            <category>Software</category>
    
    <comments>http://wavespace.info/archives/250-The-Hardy-Heron.html#comments</comments>
    <wfw:comment>http://wavespace.info/wfwcomment.php?cid=250</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://wavespace.info/rss.php?version=2.0&amp;type=comments&amp;cid=250</wfw:commentRss>
    

    <author>nospam@example.com (Guy McArthur)</author>
    <content:encoded>
    &lt;p&gt;Last week I upgraded my laptop to the latest and greatest version of Linux, Kubuntu 8.04 (code-named the Hardy Heron; each new version of Ubuntu alphabetically increments an alliterative adjective and animal).
&lt;/p&gt;

&lt;a href=&quot;http://wavespace.info/images/kubuntu0804-1.png&quot;&gt;&lt;img src=&quot;http://wavespace.info/images/kubuntu0804-1.450x281.png&quot; width=&quot;450&quot; height=&quot;281&quot;/&gt;&lt;/a&gt;

&lt;p&gt;The only issue was that when resuming from hibernation, the screen resolution would change. I filed a bug report and asked a question on a Ubuntu support page. The response was pretty quick... if I had been checking my email! The simple fix was removing a package obsoleted by the new version of X Windows. 
&lt;/p&gt;

&lt;p&gt;I&#039;m not brave enough to try the new KDE (and, apparently, neither are the Kubuntu developers, it&#039;s still optional). KDE 3.5 with a few tweaks is just about perfect IMHO, and still leagues ahead of OS X or Vista, at least in terms of functionality. The screencap shows a feature that has yet to be built into other OS&#039;s, the ability to drag-n-drop with &lt;tt&gt;sftp://&lt;/tt&gt; locations, which I find vital for website management.
&lt;/p&gt;

&lt;p&gt;There&#039;s cool and useful features like this all over the place. It&#039;s a near perfect OS!&lt;/p&gt; 
    </content:encoded>

    <pubDate>Thu, 10 Jul 2008 02:20:32 -0400</pubDate>
    <guid isPermaLink="false">http://wavespace.info/archives/250-guid.html</guid>
    
</item>
<item>
    <title>GUI Scripts?</title>
    <link>http://wavespace.info/archives/218-GUI-Scripts.html</link>
            <category>Software</category>
    
    <comments>http://wavespace.info/archives/218-GUI-Scripts.html#comments</comments>
    <wfw:comment>http://wavespace.info/wfwcomment.php?cid=218</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://wavespace.info/rss.php?version=2.0&amp;type=comments&amp;cid=218</wfw:commentRss>
    

    <author>nospam@example.com (Guy McArthur)</author>
    <content:encoded>
    &lt;p&gt;I&#039;m looking for a lightweight scripting language that can run from the command-line or desktop and with a rich set of standard widgets. Here&#039;s the catch: it should be a &lt;em&gt;modern&lt;/em&gt; language like JavaScript/ActionScript/ECMAScript.  It sounds simple, but I&#039;m not finding anything.
&lt;/p&gt;
&lt;p&gt;A long time ago I whipped up a Tcl/tK application; the language was weird and I don&#039;t want to go down that road again. Even further back, I made a small utility in REXX which was also kind of frustrating. I&#039;ve done a little Applescripting, which is truly bizarre if you&#039;re doing anything more than driving existing applications. 
&lt;/p&gt;
&lt;p&gt;Hopefully, this would run on any UNIX/Linux that has the interpreter installed. But if it&#039;s just OS X or just Linux it would be a good start.
&lt;/p&gt;
&lt;p&gt;It would also use be ideal if it used many of the same mechanisms that I&#039;m familiar with as a web developer. Events fired from the user interface and such. An API to manipulate the user interface such as the Document Object Model, or libraries that layer on top of the DOM to make it less verbose to work with.
&lt;/p&gt;
&lt;p&gt;
So, ideally the UI would be rendered in HTML, but communication would not be through a web server. The script would not be in a &quot;sandbox&quot;, so could run with all the privileges of the user. So you&#039;d have a standard UNIX script starting with the shebang (&lt;tt&gt;#!&lt;/tt&gt;), a pile of interpreted code, and a graphical user interface.
&lt;/p&gt;
&lt;p&gt;Here are the things I know of that come close to fitting the bill.
&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://wavespace.info/archives/218-GUI-Scripts.html#extended&quot;&gt;Continue reading &quot;GUI Scripts?&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Tue, 01 Apr 2008 21:37:55 -0400</pubDate>
    <guid isPermaLink="false">http://wavespace.info/archives/218-guid.html</guid>
    
</item>
<item>
    <title>Instant Slideshow</title>
    <link>http://wavespace.info/archives/185-Instant-Slideshow.html</link>
            <category>Software</category>
    
    <comments>http://wavespace.info/archives/185-Instant-Slideshow.html#comments</comments>
    <wfw:comment>http://wavespace.info/wfwcomment.php?cid=185</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://wavespace.info/rss.php?version=2.0&amp;type=comments&amp;cid=185</wfw:commentRss>
    

    <author>nospam@example.com (Guy McArthur)</author>
    <content:encoded>
    &lt;p&gt;I&#039;ve re-written this simple utility a number of times over the years, this is the latest incarnation. It lets you instantly view a slideshow of the images in a folder on a web folder. All you have to do is copy the file into the directory. Only images within that directory can be viewed, so it is safe (can&#039;t be used to get info about other directories).
&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;a href=&quot;http://guymcarthur.com/photos/punaluu/size640/&quot;&gt;An example of what I&#039;m talking about&lt;/a&gt;.&lt;/dt&gt;
&lt;dd&gt;All of the functionality is contained within a single file. It uses JavaScript to control the slideshow and PHP to build it.&lt;/dd&gt;
&lt;dt&gt;&lt;a href=&quot;http://guymcarthur.com/resources/php/index.php.html&quot;&gt;Syntax-highlighted source code&lt;/a&gt;&lt;/dt&gt;
&lt;dd&gt;Copy and paste the text into a file called &lt;tt&gt;index.php&lt;/tt&gt; in the folder. Or...&lt;/dd&gt;
&lt;dt&gt;&lt;a href=&quot;http://guymcarthur.com/resources/php/index.php.txt&quot;&gt;Raw source code&lt;/a&gt;&lt;/dt&gt;
&lt;dd&gt;Save this as a file called &lt;tt&gt;index.php&lt;/tt&gt; in the folder. Finally, open the URL to the folder in a browser. &lt;/dd&gt;
&lt;/dl&gt;
&lt;p&gt;It&#039;s dead simple, but sure is handy.
&lt;/p&gt; 
    </content:encoded>

    <pubDate>Fri, 04 Jan 2008 16:28:29 -0500</pubDate>
    <guid isPermaLink="false">http://wavespace.info/archives/185-guid.html</guid>
    <category>gallery</category>
<category>php</category>
<category>slides</category>
<category>slideshow</category>

</item>
<item>
    <title>The End of Self-Signed Certificates?</title>
    <link>http://wavespace.info/archives/184-The-End-of-Self-Signed-Certificates.html</link>
            <category>Software</category>
    
    <comments>http://wavespace.info/archives/184-The-End-of-Self-Signed-Certificates.html#comments</comments>
    <wfw:comment>http://wavespace.info/wfwcomment.php?cid=184</wfw:comment>

    <slash:comments>2</slash:comments>
    <wfw:commentRss>http://wavespace.info/rss.php?version=2.0&amp;type=comments&amp;cid=184</wfw:commentRss>
    

    <author>nospam@example.com (Guy McArthur)</author>
    <content:encoded>
    &lt;p&gt;Instead of paying $100 per year (typically) for a secure certificate, many websites use a &quot;self-signed&quot; certificate, meaning that one of the big network agencies hasn&#039;t vouched for their credentials. The benefit to the web developer (and to users) is that a secure (encrypted) web connection can be created. The downside is that the user will be prompted upon a first visit to accept the certificate, and the risk that the site and its certificate might be fraudulent. This risk is minimal for low-profile sites (who may not have the money for a certificate) who have little risk of being spoofed via spam emails for instance. Some examples [from my own web dev experience] would be webmail for a small non-profit or a protected wiki for a small to medium sized science team. In these cases, users can be informed in advance of what to expect on the first visit, and one can be reasonably sure that hackers have not set up sites with similar URLs and content to trap the unwary.
&lt;/p&gt;
&lt;p&gt;And, for what it&#039;s worth, self-signed certs are not significantly less secure or less risky than normal certificates. A hacker can obtain a minty-fresh cert for a spoof site just as easily as a legitimate site--it just means the hacker was willing to part with $100 (or whatever it is) in pursuit of far more valuable rewards. [&lt;b&gt;Update:&lt;/b&gt; This was just plain wrong, as indicated by the comment below, self-signed certs are only as secure as the method used to distribute them.]
&lt;/p&gt;
&lt;p&gt;
But I just noticed in the new Firefox (3.0 beta 2 for Mac), that accepting a self-signed certificate is now a four-step process with messages designed to scare you away from accepting such a cert. Read the rest of this entry for screenshots. I think this will be sufficient to dissuade many users from accepting a self-signed cert, no matter what they have been told up-front.
&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://wavespace.info/archives/184-The-End-of-Self-Signed-Certificates.html#extended&quot;&gt;Continue reading &quot;The End of Self-Signed Certificates?&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Thu, 03 Jan 2008 19:07:14 -0500</pubDate>
    <guid isPermaLink="false">http://wavespace.info/archives/184-guid.html</guid>
    
</item>
<item>
    <title>Is Safe Surfing Possible?</title>
    <link>http://wavespace.info/archives/180-Is-Safe-Surfing-Possible.html</link>
            <category>Software</category>
    
    <comments>http://wavespace.info/archives/180-Is-Safe-Surfing-Possible.html#comments</comments>
    <wfw:comment>http://wavespace.info/wfwcomment.php?cid=180</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://wavespace.info/rss.php?version=2.0&amp;type=comments&amp;cid=180</wfw:commentRss>
    

    <author>nospam@example.com (Guy McArthur)</author>
    <content:encoded>
    &lt;p&gt;
Have you ever done the following?
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Logged in to a web site, let&#039;s say for the sake of example, any web-based email service&lt;/li&gt;
&lt;li&gt;While still logged in, visited another site, perhaps just clicking on a link in an email, or viewing an HTML email&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
Now, you have just opened the doors wide for an attack. A malicious script could (for instance) grab your email or do anything else the programming interface (the web API) of the site you are logged into, allows. &lt;a href=&quot;http://www.davidairey.com/google-gmail-security-hijack/&quot;&gt;This chilling story&lt;/a&gt; indicates the extent of your vulnerability. A script used the GMail API to insert a rule that forwarded all email concerning domain names to a site hijacker.  The hijacker then sent an email to a domain registrar, and quickly and easily had control of the person&#039;s business web site. Most likely the exploit was a script uploaded to a web forum or other insecure page, where upon it attempted the same for everyone who viewed that page. It could even be in an image tag in a HTML spam email--no action required on the victims part.
&lt;/p&gt;
&lt;p&gt;
I&#039;ve known about this style of attack (now called a XSRF or cross-site request forgery) for many years. How do you ensure that a request coming in is legitimate? After all, it is the web, legitimate use could be coming in from any Internet Protocol address. One barricade that can be placed in the way of hackers is to use what is called the referrer or &quot;HTTP referer&quot; (mis-spelled in the original specification). This is information that the web browser provides indicating which &lt;b&gt;URL&lt;/b&gt; the request came from. For example, only Google URLs should be accessing GMail settings. 
&lt;/p&gt;
&lt;p&gt;
This information however can be spoofed, for example by writing a program that emulates a browser (and this is much easier than it may sound to the non-programmer). A larger problem is then distributing the program so that victims inadvertently use it, which is where well-known techniques of code injection such as viruses come into play. Even simpler is to use a Flash applet stuck on a web page, which you will probably not even be aware of running when you stumble over it. But apparently Google&#039;s GMail did not have even this low barricade, allowing simple scripts to directly access the settings (of any GMail user who was currently logged in while being subjected to the evil script).&lt;/p&gt;

&lt;p&gt;So, the question is, is there any way to safely browse? After all, banking, shopping, and many forms of communicating now take place primarily via the web.&lt;/p&gt;
 &lt;br /&gt;&lt;a href=&quot;http://wavespace.info/archives/180-Is-Safe-Surfing-Possible.html#extended&quot;&gt;Continue reading &quot;Is Safe Surfing Possible?&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Fri, 28 Dec 2007 13:23:07 -0500</pubDate>
    <guid isPermaLink="false">http://wavespace.info/archives/180-guid.html</guid>
    <category>hacking</category>
<category>http</category>
<category>web</category>
<category>webmail</category>

</item>
<item>
    <title>One Dozen Mac Annoyances</title>
    <link>http://wavespace.info/archives/170-One-Dozen-Mac-Annoyances.html</link>
            <category>Software</category>
    
    <comments>http://wavespace.info/archives/170-One-Dozen-Mac-Annoyances.html#comments</comments>
    <wfw:comment>http://wavespace.info/wfwcomment.php?cid=170</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://wavespace.info/rss.php?version=2.0&amp;type=comments&amp;cid=170</wfw:commentRss>
    

    <author>nospam@example.com (Guy McArthur)</author>
    <content:encoded>
    &lt;p&gt;
Here&#039;s my top-12 list of Mac annoyances, things that suck about Mac OS X. I bought a Mac Mini in the fall of 2005, a 1.2 GHz model with 512 MB of RAM. Around the same time my work machine became a G5 quad (actually a dual dualie) with 2GB of RAM (since upgraded to 4). Last year I got a Dell Inspiron B130 laptop, which is now my main machine at home, relegating the mini to a server for &lt;a href=&quot;http://guymcarthur.com/resources/gadgets/squeezebox.xml&quot;&gt;music&lt;/a&gt;. The laptop runs Kubuntu, a derivative of Debian Linux with the KDE desktop, which supports it very well.
&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;1. &lt;b&gt;Poor Performance&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;OS X is beyond dog slow, it is slug slow. Windows XP or Linux on a ten-year-old Pentium II will be snappier than OS X. Even on high-end hardware, it is not discernably more responsive. In general, most applications are poorly threaded and the spinning beach ball busy cursor is always around the corner. For instance in Firefox, when launching a tab, you&#039;ll frequently be unable to do anything with the Finder menu while the tab is connecting. 
&lt;/dd&gt;
&lt;dt&gt;2. &lt;b&gt;iPhoto&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;iPhoto is the all-time champion when it comes to poor performance, taking a minute to load up. It is such a memory hog that minimizing it to switch to other applications, or maximizing it again, takes almost another minute.
&lt;/dd&gt;
&lt;dt&gt;3. &lt;b&gt;Lack of package management&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;Debian has &lt;tt&gt;apt-get&lt;/tt&gt; or the graphical versions &lt;i&gt;Adept&lt;/i&gt; or &lt;i&gt;Synaptic&lt;/i&gt;, which make installing (or un-installing) any one of over ten thousand applications and libraries a one-step procedure, complete with finding and installing all their dependencies, synchronized with an always up-to-date online catalog. The technique is used in nearly all Linux distributions and was perfected in Debian years ago. In contrast, OS X has the concept of dragging an application bundle to a folder. Each bundle (usually) includes its own copy of those libraries that it depends on, leading to bloat. If you want to upgrade to the latest version, there is no automated way to do it.
&lt;/dd&gt;
&lt;dt&gt;4. &lt;b&gt;Poor previewing&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;In KDE, you can set the icon size to be different than the size of image previews (when viewing a folder). In OS X, you cannot. Either you have nicely sized icons and tiny previews, or giant icons and nice previews. What&#039;s more if you select a set of images for a slideshow, they are in random order, with no apparent way of changing the order! Preview.app is also flawed; you can&#039;t view a selected set of images at their actual size, instead you must hit &#039;actual size&#039; on each individual one.
&lt;/dd&gt;
&lt;/dl&gt;
 &lt;br /&gt;&lt;a href=&quot;http://wavespace.info/archives/170-One-Dozen-Mac-Annoyances.html#extended&quot;&gt;Continue reading &quot;One Dozen Mac Annoyances&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Mon, 26 Mar 2007 00:50:12 -0400</pubDate>
    <guid isPermaLink="false">http://wavespace.info/archives/170-guid.html</guid>
    
</item>
<item>
    <title>Joggle Update</title>
    <link>http://wavespace.info/archives/169-Joggle-Update.html</link>
            <category>Software</category>
    
    <comments>http://wavespace.info/archives/169-Joggle-Update.html#comments</comments>
    <wfw:comment>http://wavespace.info/wfwcomment.php?cid=169</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://wavespace.info/rss.php?version=2.0&amp;type=comments&amp;cid=169</wfw:commentRss>
    

    <author>nospam@example.com (Guy McArthur)</author>
    <content:encoded>
    &lt;p&gt;I tuned up the Javascript / DOM code for the &lt;a href=&quot;http://guymcarthur.com/projects/joggle/&quot;&gt;AJAX version of Joggle&lt;/a&gt;. Someday I will get around to a network, multi-player version, a cell phone version, and more. Sadly, I can barely get onto the high scores list of my own game. It&#039;s tough!&lt;/p&gt; 
    </content:encoded>

    <pubDate>Mon, 26 Mar 2007 00:31:09 -0400</pubDate>
    <guid isPermaLink="false">http://wavespace.info/archives/169-guid.html</guid>
    
</item>
<item>
    <title>What A Character</title>
    <link>http://wavespace.info/archives/162-What-A-Character.html</link>
            <category>Software</category>
    
    <comments>http://wavespace.info/archives/162-What-A-Character.html#comments</comments>
    <wfw:comment>http://wavespace.info/wfwcomment.php?cid=162</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://wavespace.info/rss.php?version=2.0&amp;type=comments&amp;cid=162</wfw:commentRss>
    

    <author>nospam@example.com (Guy McArthur)</author>
    <content:encoded>
    &lt;p&gt;
I couldn&#039;t find a really good guide to typing in extended characters in Linux (KDE specifically), so I&#039;ve compiled what I&#039;ve found into a table. Each OS does this a different way. I remember on Windows and OS/2 it was ALT + numeric id of character, so for the &#039;é&#039; in résumé you&#039;d have to remember that &#039;é&#039; is 233 is extended ASCII. Or you&#039;d just use the charmap application, which involved a lot of clicking. Mac OS X has it&#039;s own way of doing things as far as character combinations go, and there&#039;s always a little pull-down menu you can get to for obscure characters.
&lt;/p&gt;

&lt;p&gt;
KDE is very nicely designed and has an elegant way of entering in extended characters. You type the compose key, which by default is the right &#039;Win&#039; key. My laptop doesn&#039;t have a right &#039;Win&#039; key, so I&#039;ve configured caps lock as the compose key; I never use caps lock otherwise... it is an anachronism. Anyways, you hit &amp;amp; release the compose key, then press the keys which are shown in my chart. For &#039;é&#039;, it would be &amp;lt;compose&amp;gt; then apostrophe and e. The mnemonics seem to be easier to remember than Mac OS. I.e. &lt;tt&gt;e + &lt;i&gt;&#039;&lt;/i&gt; = é&lt;/tt&gt;.
&lt;/p&gt;

&lt;p&gt;
&lt;a href=&quot;http://guymcarthur.com/resources/linux/iso-8859-1.html&quot; title=&quot;char chart&quot;&gt;Here is the table&lt;/a&gt;.
&lt;/p&gt;
 
    </content:encoded>

    <pubDate>Thu, 15 Mar 2007 00:08:11 -0400</pubDate>
    <guid isPermaLink="false">http://wavespace.info/archives/162-guid.html</guid>
    <category>ascii</category>
<category>characters</category>
<category>kde</category>
<category>linux</category>

</item>
<item>
    <title>Cooking With Flash</title>
    <link>http://wavespace.info/archives/158-Cooking-With-Flash.html</link>
            <category>Software</category>
    
    <comments>http://wavespace.info/archives/158-Cooking-With-Flash.html#comments</comments>
    <wfw:comment>http://wavespace.info/wfwcomment.php?cid=158</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://wavespace.info/rss.php?version=2.0&amp;type=comments&amp;cid=158</wfw:commentRss>
    

    <author>nospam@example.com (Guy McArthur)</author>
    <content:encoded>
    &lt;p&gt;In my experience, &lt;a href=&quot;http://www.oreilly.com/&quot;&gt;O&#039;Reilly press&lt;/a&gt; has consistently made the best technical books. I&#039;ve owned or at least borrowed (heavily) more than a few, particularly those in the Java, Perl, and UNIX lines.
&lt;/p&gt;

&lt;a title=&quot;ActionScript 3.0 Cookbook&quot; href=&quot;http://www.amazon.com/gp/product/0596526954?ie=UTF8&amp;amp;tag=guymcarthurco-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=9325&amp;amp;creativeASIN=0596526954&quot;&gt;&lt;img  src=&quot;uploads/as3_cookbook.jpg&quot; class=&quot;left&quot; alt=&quot;ActionScript 3.0 Cookbook&quot;/&gt;&lt;/a&gt;

&lt;p&gt;
So when I wanted to learn ActionScript (Flash), I was pleased to find &lt;i&gt;ActionScript 3.0 Cookbook&lt;/i&gt;. I immediately found section titles specifically geared for what I wanted to do, like loading images via URL, scrolling, passing variables from HTML pages. Furthermore, the first few chapters got me up to speed on language basics very quickly. The &quot;cookbook&quot; style text works extremely well for learning a new language when you are already familiar with the concepts, such as event handlers or associative arrays. I had written a nearly complete version of what I envisioned that evening, and finished it in another evening. Glancing at other sections, it looks like this book will continue to work for me up the learning curve for quite some time. All in all, this is one of the best titles from O&#039;Reilly, which means it is really quite exceptional. Coupled with the &lt;a href=&quot;http://livedocs.macromedia.com/flex/2/langref/&quot;&gt;language reference&lt;/a&gt; and &lt;a href=&quot;http://www.adobe.com/products/flex/sdk/&quot;&gt;SDK&lt;/a&gt;, it&#039;s all you need to get started.
&lt;/p&gt;
&lt;p&gt;
ActionScript 3.0 combines the best of Java (strongly typed, object-oriented, namespaces, compiled) and JavaScript (simplicity, syntax). Actually, it looks like ActionScript 3.0 and JavaScript 2.0 will be one and the same; AS3 will be formalized as the next version of the JavaScript standard. Adobe has donated the virtual machine to the Mozilla project for use in future versions of Firefox and other applications.
&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://wavespace.info/archives/158-Cooking-With-Flash.html#extended&quot;&gt;Continue reading &quot;Cooking With Flash&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Tue, 13 Feb 2007 00:00:50 -0500</pubDate>
    <guid isPermaLink="false">http://wavespace.info/archives/158-guid.html</guid>
    <category>actionscript</category>
<category>applets</category>
<category>flash</category>
<category>o'reilly</category>

</item>
<item>
    <title>Flash Forward</title>
    <link>http://wavespace.info/archives/157-Flash-Forward.html</link>
            <category>Software</category>
    
    <comments>http://wavespace.info/archives/157-Flash-Forward.html#comments</comments>
    <wfw:comment>http://wavespace.info/wfwcomment.php?cid=157</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://wavespace.info/rss.php?version=2.0&amp;type=comments&amp;cid=157</wfw:commentRss>
    

    <author>nospam@example.com (Guy McArthur)</author>
    <content:encoded>
    &lt;p&gt;
Here&#039;s my first Flash &quot;movie&quot; (I prefer the term &quot;applet&quot;). Since our (&lt;a href=&quot;http://hirise.lpl.arizona.edu/&quot;&gt;HiRISE&lt;/a&gt;) images typically have unusual aspect ratios (like 1:4 or 1:8), this Scroller allows the thumbnail versions to be embedded in a web page like a more commonly sized image (1:1 or 4:3). It also displays a scale bar, which may be dragged around.
&lt;/p&gt;

&lt;script type=&quot;text/javascript&quot; src=&quot;http://wavespace.info/uploads/swfobject.js&quot;&gt;&lt;/script&gt;
&lt;div id=&quot;flash&quot;&gt;&lt;!-- Flash content is inserted here --&gt;&lt;/div&gt;

&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--
   // scale is 10.024 meters per pixel
   // movie, name, width, height, version, background-color
   var swf = new SWFObject(&quot;/uploads/Scroller.swf&quot;, &quot;scroller&quot;, &quot;468&quot;, &quot;468&quot;, &quot;8&quot;, &quot;#ffffff&quot;);
   swf.addVariable(&#039;image&#039;, &#039;/uploads/PSP_001336_1560_RGB.thumb.jpg&#039;);
   swf.addVariable(&#039;scale&#039;, &#039;500 meters&#039;);
   swf.addVariable(&#039;length&#039;, &#039;46&#039;);
   swf.write(&#039;flash&#039;);
   // --&gt;
&lt;/script&gt;

&lt;p&gt;
The &lt;a href=&quot;http://guymcarthur.com/projects/as3/Scroller.html&quot;&gt;sourcecode is available&lt;/a&gt;.
&lt;/p&gt; 
    </content:encoded>

    <pubDate>Mon, 12 Feb 2007 23:47:49 -0500</pubDate>
    <guid isPermaLink="false">http://wavespace.info/archives/157-guid.html</guid>
    <category>applet</category>
<category>examples</category>
<category>flash</category>
<category>hirise</category>
<category>mars</category>
<category>programming</category>
<category>scroller</category>
<category>source code</category>

</item>

</channel>
</rss>