<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>Tom Wyant</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/tom_wyant/" />
    <link rel="self" type="application/atom+xml" href="http://blogs.perl.org/users/tom_wyant/atom.xml" />
    <id>tag:blogs.perl.org,2009-11-03:/users/tom_wyant//506</id>
    <updated>2013-02-16T18:17:38Z</updated>
    <subtitle>A blog about the Perl programming language</subtitle>
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type Pro 4.38</generator>

<entry>
    <title>Astro::SpaceTrack upgrade</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/tom_wyant/2013/02/astrospacetrack-upgrade.html" />
    <id>tag:blogs.perl.org,2013:/users/tom_wyant//506.4337</id>

    <published>2013-02-16T17:55:17Z</published>
    <updated>2013-02-16T18:17:38Z</updated>

    <summary>For some time now, the Space Track web site, which is the official source for satellite orbital elements, has been working on an upgrade to a REST interface. This interface is scheduled to go live on February 20. My module...</summary>
    <author>
        <name>Tom Wyant</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://blogs.perl.org/users/tom_wyant/">
        <![CDATA[<p>For some time now, the Space Track web site, which is the official source for satellite orbital elements, has been working on an upgrade to a REST interface. This interface is scheduled to go live on February 20.</p>

<p>My module Astro::SpaceTrack retrieves orbital data from the Space Track web site. To track this change, I intend shortly to release a new version of Astro::SpaceTrack which uses the REST interface by default. My understanding is that the old, screen-scraping interface will be available for an indefinite (but finite) time. For details, click on the post title for the extended version of the post.</p>]]>
        <![CDATA[<p>For some time now, the Space Track web site, which is the official source for satellite orbital elements, has been working on an upgrade to a REST interface. This interface is scheduled to go live on February 20.</p>

<p>I have been tracking this work in the Astro::SpaceTrack package, which retrieves data from the Space Track web site. This module uses the <code>space_track_version</code> attribute to determine which interface to use to access the Space Track web site: A value of <code>1</code> (the default) gets you the old, screen scraping interface, and a value of <code>2</code> gets you the new REST interface.</p>

<p>I intend to release, shortly, a production version of Astro::SpaceTrack which makes a single change: the default value of the <code>space_track_version</code> interface will become <code>2</code>. The screen-scraping interface will still be available by explicitly setting the value of the <code>space_track_version</code> attribute to <code>1</code>. I understand that this interface will remain available once the REST interface goes live, for an indefinite (but finite) period. Because I have no control over the life of the screen-scraping interface, users would do well to move to the REST interface as soon as they reasonably can.</p>

<p>Once the REST interface becomes live, I intend to make another production release, whose sole change is to access the REST interface through the production URL rather than the beta URL. This release will also deprecate the screen-scraping interface.</p>

<p>Some time down the road the screen-scraping interface will go away, both on the Space Track web site and (as soon as I notice) in Astro::SpaceTrack.</p>]]>
    </content>
</entry>

<entry>
    <title>The Case of the Unexpected Pax</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/tom_wyant/2012/12/the-case-of-the-unexpected-pax.html" />
    <id>tag:blogs.perl.org,2012:/users/tom_wyant//506.4090</id>

    <published>2012-12-01T18:11:58Z</published>
    <updated>2012-12-01T18:14:18Z</updated>

    <summary>It was late afternoon of a chill November in Paris. I was walking along the quai, lost in a brown study. Looking up, I saw my friend C. Auguste Dupin approaching me. &quot;Ah, bon soir, mon ami,&quot; said Dupin, &quot;and...</summary>
    <author>
        <name>Tom Wyant</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://blogs.perl.org/users/tom_wyant/">
        <![CDATA[<p>It was late afternoon of a chill November in Paris. I was walking along the <i>quai</i>, lost in a brown study. Looking up, I saw my friend C.  Auguste Dupin approaching me.</p>

<p>"Ah, <i>bon soir, mon ami</i>," said Dupin, "and what brings you beside the Seine on this crisp evening?"</p>

<p>"Something has been puzzling me," I replied, "and I thought the walk would give my thoughts an opportunity to put themselves in order."</p>

<p>"It is a day of puzzlements, no? Will you not share your puzzlement with me?"</p>

<p>"Well," I demurred, "it is a small thing -- probably something I did to myself. But I do not wish to intrude on your time."</p>

<p>"Ah, but it is no intrusion for a friend."</p>

<p>"Well," I said as we turned across the <i>Pont Neuf</i>, "as you know I dabble in Perl, and I like to keep a variety of systems available for testing purposes. I upgraded one of these and was re-installing Perl, when one single module failed to install -- indeed, failed to unpack."</p>

<p>"Perhaps the author had the misfortune to make a bad package."</p>

<p>"No, I don't think so. The same package unpacked and installed correctly on other systems. I suspected something OS-specific, but Perl Testers reports no such problems with the package. Then I suspected my <code>cpan</code> client, but I deleted everything from the <code>.cpan</code> directory but the configuration, to no avail."</p>

<p>"Most unusual. You say this distribution failed to unpack. Can you be specific?"</p>

<p>"Yes," I replied as we turned onto the <i>Quai de Conti</i>, "it was odd. When I used the cpan <code>look</code> command, I found myself in a directory named after the author of the package. That directory contained the actual package in a subdirectory, along with some other stuff."</p>

<p>"In a subdirectory you say? Was it a good copy?"</p>

<p>"Yes. I was able to install from it by hand, the only problem being that there was a dependency to take care of."</p>

<p>"And this so-called 'other stuff'," Dupin pursued, "of what did it consist?"</p>

<p>"It was a directory -- <code>PaxHeaders.11295</code> or some such.  I did not look into it."</p>

<p>"Ah, that is very interesting. Tell me also under what operating system did you experience this problem?"</p>

<p>"OpenBSD. I had no problems under FreeBSD or Linux."</p>

<p>"Yes, that follows. But to complete the picture we need one final piece.  Tell me, <i>mon ami,</i> how have you set up <code>cpan</code> to unpack your distributions?"</p>

<p>"I don't know. The default I suppose, whatever that is. Does it make a difference?"</p>

<p>"It does indeed, <i>mon ami</i>," Dupin replied. The <code>cpan</code> client uses setting <code>prefer_external_tar</code> to determine whether it uses an external executable or Perl modules to unpack the distribution. Unless you explicitly set this, it tends to be <code>1</code>, which uses an external <code>tar</code>, or <code>undef</code>, which leaves it to discretion of the <code>CPAN::Tarzip</code> code.</p>

<p>"I still don't see the point," I exclaimed, "<code>tar</code> is <code>tar</code>, is it not?"</p>

<p>"By no means!" Dupin asserted. "This pax that gives you no peace was an archiver introduced to try to unify <code>tar</code> and <code>cpio</code>. It never really caught on, but the format was enshrined in a POSIX standard, and some <code>tar</code> programs add <code>pax</code> metadata in response to <code>--format=posix</code>. Linux uses Gnu <code>tar</code>, which understands this sort of thing. FreeBSD use <code>bsdtar</code>, which can also cope with the <code>pax</code> metadata. OpenBSD, however, does not."</p>

<p>"So I have to replace the system <code>tar</code> with Gnu <code>tar</code>?"</p>

<p>"Indeed, that is what <code>CPAN::Tarzip</code> suggests. But on a new installation such as yours, or any installation with a modern <code>Archive::Tar</code>, it suffices to set <code>prefer_external_tar</code> to <code>0</code>."</p>

<p>"Just that? I am tempted to misquote the Bard of Avon: 'The fault, dear Brutus, is not in our selves but in our <code>tar</code>.'"</p>

<p><i>With apologies to Shakespeare as well as Poe.</i></p>

<p><i>This was a problem I ran into recently. With no Dupin to guide me I went to even greater lengths than Dupin's anonymous friend to try to sort the problem out. Eventually I convinced myself that the system <code>tar</code> itself gave rise to the extra file, which confused <code>CPAN::Tarzip</code> mightily. Yes, I could have painstakingly characterized the various <code>tar</code> programs involved, but it was much easier to turn off <code>prefer_external_tar</code> and see if that fixed the problem. It did, and the rest was, well, not so much history as a blog entry inflicted on long-suffering readers.</i></p>

<p><i>The couple of sentences on the origins of <code>pax</code> are derived (perhaps faultily) from the relevant <a href="http://en.wikipedia.org/wiki/Pax_%28Unix%29">Wikipedia article</a>.</i><br />
</p>]]>
        
    </content>
</entry>

<entry>
    <title>The Case of the Incompatible Safe -- Epilog</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/tom_wyant/2012/07/the-case-of-the-incompatible-safe----epilog.html" />
    <id>tag:blogs.perl.org,2012:/users/tom_wyant//506.3449</id>

    <published>2012-07-01T18:06:49Z</published>
    <updated>2012-07-01T18:10:01Z</updated>

    <summary>&quot;You know,&quot; I said to my friend C. Auguste Dupin, &quot;I can not help feeling that there must be a simpler solution for M. Tueur&apos;s problem of the Incompatible Safe&quot;. &quot;But there is, mon ami -- now.&quot; &quot;Now? Why now...</summary>
    <author>
        <name>Tom Wyant</name>
        
    </author>
    
        <category term="Safe" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://blogs.perl.org/users/tom_wyant/">
        <![CDATA[<p>"You know," I said to my friend C. Auguste Dupin, "I can not help feeling that there must be a simpler solution for M. Tueur's problem of the <a href="http://blogs.perl.org/users/tom_wyant/2012/01/the-case-of-the-incompatible-safe.html">Incompatible Safe</a>".</p>

<p>"But there is, <cite>mon ami</cite> -- now."</p>

<p>"Now? Why now and not before?"</p>

<p>"Because in the interim, M. Garcia-Suarez, the author of the <a href="http://search.cpan.org/dist/Safe/">Safe</a> module, has enhanced it to work nicely with <a href="http://search.cpan.org/dist/Devel-Cover/">Devel::Cover</a>."</p>

<p>"Wonderful," I replied. "It must have been a complicated matter."</p>

<p>"Simplicity itself, <cite>mon ami</cite>. He simply adds <code>'&amp;Devel::Cover::use_file'</code> to the default share list if <code>Devel::Cover</code> is detected."</p>

<p>"So, Dupin, you know this M. Suarez-Garcia and informed him of the problem?"</p>

<p>"<cite>Non, mon ami,</cite> this was done without my involvement. Though it would be nice to think that your small note upon the problem helped to bring it to his attention."</p>

<p><cite>My apologies to Rafa&euml;l Garcia-Suarez and my readers for being so long about writing this epilog. The change was made in version 2.32 released March 31 2012. His solution could probably have been implemented by hand, but though Dupin is certainly smart enough to figure this out, I was not.</cite></p>

<p><cite>No, I do not consider a blog entry a substitute for an RT ticket, but in this case I was unsure which module to ticket, and then other things in life intervened.</cite><br />
</p>]]>
        
    </content>
</entry>

<entry>
    <title>Stupid ack trick</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/tom_wyant/2012/02/stupid-ack-trick.html" />
    <id>tag:blogs.perl.org,2012:/users/tom_wyant//506.2819</id>

    <published>2012-02-15T01:20:29Z</published>
    <updated>2012-02-15T01:26:18Z</updated>

    <summary>My source directories tend to collect cruft, and it can be a pain to separate the real ack hits from the crufty ones. I am ashamed to say how long it took me to think of the following: function ackx...</summary>
    <author>
        <name>Tom Wyant</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://blogs.perl.org/users/tom_wyant/">
        <![CDATA[<p>My source directories tend to collect cruft, and it can be a pain to separate the <strong>real</strong> <code>ack</code> hits from the crufty ones. I am ashamed to say how long it took me to think of the following:</p>

<p><code><pre>function ackx {<br />
    if [ -f MANIFEST ];<br />
    then ack "$@" `sed 's/[[:space:]].*//' MANIFEST`;<br />
    else ack "$@";<br />
    fi<br />
}<br />
</pre></code></p>

<p>Yes, this could equally well have been a small Perl script involving <a href="http://search.cpan.org/dist/ExtUtils-Manifest/">ExtUtils::Manifest</a>, as a more portable implementation, and a cleaner way to get rid of any comments.</p>]]>
        
    </content>
</entry>

<entry>
    <title>The Case of the Incompatible Safe</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/tom_wyant/2012/01/the-case-of-the-incompatible-safe.html" />
    <id>tag:blogs.perl.org,2012:/users/tom_wyant//506.2738</id>

    <published>2012-01-27T15:51:28Z</published>
    <updated>2012-01-27T19:10:41Z</updated>

    <summary>When I entered our rooms, I found C. Auguste Dupin lounging in his fauteuil by the window. His eyes were on the paper in his hand, but he seemed to be gazing beyond it in abstracted thought. &quot;A death?&quot; I...</summary>
    <author>
        <name>Tom Wyant</name>
        
    </author>
    
        <category term="Mock objects" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Safe" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://blogs.perl.org/users/tom_wyant/">
        <![CDATA[<p>When I entered our rooms, I found C. Auguste Dupin lounging in his <i>fauteuil</i> by the window. His eyes were on the paper in his hand, but he seemed to be gazing beyond it in abstracted thought.</p>

<p>"A death?" I asked, smiling, remembering the events of a few days previous.</p>

<p>"<i>Non, mon ami</i>, simply a puzzle, and a rather pretty one. It appears that one M. Tueur, in attempting to improve his Perl, has entrapped himself in a web of conflicting requirements from which he can not extricate himself."</p>

<p>"Better him than me," I observed. "How did this come about?"</p>

<p>"Very simply. He found himself in a position where he had a string containing <code>Data::Dumper</code> output, which he needed to load back into his code. Now, normally this requires a stringy <code>eval</code>, but since he was justly cautious about doing this, he decided to use the <code>Safe</code> module instead."</p>

<p>"A wise precaution," I remarked, trying to hold up my end of the conversation.</p>

<p>"But then he wanted to do coverage testing."</p>

<p>"Another wise decision. It is a well-known axiom that untested code is buggy code. But when do the conflicting requirements come in?"</p>

<p>"Ah, they have already done so, <i>mon ami.</i> <code>Devel::Cover</code>, in order not to pollute the name spaces in which it runs, makes fully-qualified calls to itself, which can not be resolved from inside a <code>Safe</code> compartment. So however great his test coverage might have been, by simply trying to measure it he ensures that code below his calls to <code>Safe</code>'s <code>reval()</code> method is not executed."</p>

<p>"By blazes! That is a poser. What can he do? I suppose he could change his code to detect the loading of <code>Devel::Cover</code>, and fall back to a stringy eval. But no, you don't want to change production code just to test it."</p>

<p>"<i>Non, non</i> that is never wise," replied Dupin.</p>

<p>"Wait. He could write a mock <code>Safe</code> object, and use that in his testing. His <code>new()</code> would return a blessed reference to an empty hash, and his <code>reval()</code> could simply do a stringy <code>eval</code> on its argument. Other methods could simply return."</p>

<p>"How, then, will he know that his calls to <code>Safe</code> actually function as he expects? It may be that he needs to adjust the operand mask allowed by his <code>Safe</code> compartment. If he uses a mock object in his normal testing, he will not discover this."</p>

<p>"You're right. Whatever he does he gives up something. Do you have any thoughts, Dupin?"</p>

<p>"A small one only, I fear. Your idea of the mock object has merit, but it must be more selective in its application. Suppose M. Tueur had a way to use the mock object <strong>only</strong> when he is doing coverage testing, but <strong>without</strong> modifying his production code?"</p>

<p>"Can this thing be done be done?" I asked. "It seems impossible".</p>

<p>"Not impossible. He can simply place his mock object in a directory of its own, <code>mock/cover/</code> for example, and insert that directory into <code>@INC</code> only when he is doing coverage testing.</p>

<p>"There are a number of ways to do this. He could detect the loading of <code>Devel::Cover</code> in his test modules, and modify <code>@INC</code> there, either directly or by calling <code>lib-&gt;import()</code>.</p>

<p>"But if he is using <code>Module::Build</code>, a better way is simply to subclass that module, and add the following code to the subclass:</p>

<pre><code>
sub ACTION_testcover {
    my ( $self, @args ) = @_;
    local @INC = ( 'mock/cover', @INC );
    return $self-&gt;SUPER::ACTION_testcover( @args );
}
</code></pre>

<p>"In this way, the change is centralized to the one place where it is<br />
<strong>known</strong> that a coverage test is being requested."</p>

<p>"Well, I'll be ..." But I was at a loss for words, and the sentence was left dangling in the air of Paris.</p>

<p><i>I confess to being not entirely satisfied with the solution that I have placed into the mouth of M. Dupin (which is a workaround rather than a real solution), and am left with the feeling that the shade of Edgar Allen Poe, in his capacity as analyst of Maelzel's chess-playing engine, deserves better. But after a day or so of ringing the changes on Safe's <code>share_from()</code> method, a mock object was the best I could do. Maybe there is a simpler solution, but the RT queue for the <code>Safe</code> distribution says that at least one other person is as fuddled as I am. Readers?</i></p>]]>
        
    </content>
</entry>

<entry>
    <title>The Case of the Overloaded Curlys</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/tom_wyant/2012/01/the-case-of-the-overloaded-curlys.html" />
    <id>tag:blogs.perl.org,2012:/users/tom_wyant//506.2667</id>

    <published>2012-01-11T19:26:09Z</published>
    <updated>2012-01-11T19:27:37Z</updated>

    <summary>When I entered our rooms in Paris after a day on the boulevards, I found C. Auguste Dupin at his desk contemplating a scrap of paper. &quot;A problem?&quot; I asked. &quot;A death. And a rather gruesome one, n&apos;est-ce pas?&quot; he...</summary>
    <author>
        <name>Tom Wyant</name>
        
    </author>
    
        <category term="Perl syntax" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://blogs.perl.org/users/tom_wyant/">
        <![CDATA[<p>When I entered our rooms in Paris after a day on the boulevards, I found C. Auguste Dupin at his desk contemplating a scrap of paper. "A problem?" I asked.</p>

<p>"A death. And a rather gruesome one, <i>n'est-ce pas?</i>" he replied, handing me the paper. On it I saw:</p>

<p><code><pre><br />
$ perl -e '%h = map { "-$_" =&gt; 1 } qw{ foo bar };'<br />
Not enough arguments for map at -e line 1, near "} qw{ foo bar }"<br />
syntax error at -e line 1, near "} qw{ foo bar }"<br />
Execution of -e aborted due to compilation errors.<br />
</pre></code></p>

<p>Well, a <code>map</code> takes either a block or an expression followed by a comma, and either must be followed by a list. The block was there, and so was the list. Clearly a neophite had been playing with bleadperl, and paid the price. With a rueful shake of my head, I silently passed the paper back to the detective.</p>

<p>"No, this was a production release of Perl, <i>mon ami</i>."</p>

<p>"But how --" I expostulated.</p>

<p>"-- did I know what you were thinking? Simple observation. When I gave you the paper, your brow contracted in puzzlement. This was succeeded by the abstracted expression of deep thought. Your right thumb played back and forth between the first two fingers, as though considering two alternatives, thus I knew you were thinking of the two forms of <code>map</code>. Your expression of rueful pity for the victim as you returned the paper to me completed the picture."</p>

<p>"But how --" I began again.</p>

<p>"-- can a production version of Perl fail to parse such an obviously correct <code>map</code>? Ah, that is a deeper problem. The solution lies in the fact that in Perl, curly brackets are overloaded, and may be used either as block delimiters or a hash constructor.</p>

<p>"The <code>map</code> takes either an expression or a block as its first argument, and the documentation states plainly that the Perl parser must choose between these alternatives before it analyzes the entire statement, and that, absent clear clues, it guesses." His face assumed an expression of something like revulsion as he pronounced the last word. "Since the parse failure makes no sense with a block, it must be that Perl parsed the curly brackets as a hash constructor, and therefore as an expression. The comma which must follow an expression was not found, lacking which a painful death ensued.</p>

<p>"But how --" I broke in for the third time.</p>

<p>"-- could this tragedy have been prevented? Nothing simpler. The <code>perlref</code> document states that a unary plus sign before the left curly bracket forces it to be interpreted as a hash constructor, and a semicolon after it forces the interpretation to be a block. Two simple strokes could have prevented this horrible death."</p>

<p>And with his pen, he inserted the semicolon which would have spared the victim's life:</p>

<p><code><pre><br />
$ perl -e '%h = map {; "-$_" =&gt; 1 } qw{ foo bar };'<br />
</pre></code></p>

<p><i>With apologies to Edgar Allen Poe for borrowing his detective (whom I return, I hope, only a little worse for wear), and to Francophones for possible butchering of their language. The one-liner is an abstraction of a piece of code that puzzled me, until I remembered that Perl might not see the <code>map</code> the same way I did.</i></p>]]>
        
    </content>
</entry>

<entry>
    <title>Perl droplets for Mac OS X</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/tom_wyant/2011/12/perl-droplets-for-mac-os-x.html" />
    <id>tag:blogs.perl.org,2011:/users/tom_wyant//506.2527</id>

    <published>2011-12-02T18:08:54Z</published>
    <updated>2011-12-02T18:55:18Z</updated>

    <summary>The editor that came with MacOS Perl (for Mac OS 9 and below) was able to save your script as a droplet -- that is, an application that you could run by dropping files onto it. When your script got...</summary>
    <author>
        <name>Tom Wyant</name>
        
    </author>
    
        <category term="Mac OS X" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://blogs.perl.org/users/tom_wyant/">
        <![CDATA[<p>The editor that came with MacOS Perl (for Mac OS 9 and below) was able to save your script as a droplet -- that is, an application that you could run by dropping files onto it. When your script got control, the paths to the dropped files were in @ARGV</p>

<p>Under Mac OS X you can get this functionality by wrapping your Perl script in an Apple Script. The following example assumes you want to wrap a Perl script named <code>droplet.PL</code> in an application called <code>PerlDroplet</code>. It works because a Mac OS X application bundle is simply a directory whose contents are known to the system.</p>

<ol>
<li>Run the Script Editor, which is found in <code>/Applications/AppleScript/</code></li>
<li>Paste the text of the Apple Script as it appears below into the editor.</li>
<li>Save the script as an Application Bundle named PerlDroplet.</li>
<li>Copy your Perl script to directory <code>PerlDroplet.app/Contents/Resources/</code>.</li>
</ol>

<p>Yes, this will work if you move PerlDroplet somewhere else.</p>

<p>The 'do shell script' directive used to get the Perl script to run will actually work on any command that <code>/bin/sh</code> can handle. This means you need a shebang line in your script, or you need to explicitly run Perl. The <code>do shell script</code> is the equivalent of Perl's back tick or <code>qx{}</code> operators; anything the command writes to standard out is returned to the Apple Script.</p>

<p>The environment your script sees is fairly minimal. Specifically, you will <strong>not</strong> see anything you defined in your <code>.profile</code> or <code>.bash_profile</code> file. You <strong>will</strong>, however, see anything you define in <code>~/.MacOSX/environment.plist</code> -- that is, once you log out and log back in again. Restarting the finder is <strong>not</strong> sufficient.</p>

<p>OK, at long last here is the actual Apple Script. The blogging software truncates it on the right, but it turns out that if you select everything and do a <code>Copy</code>, the un-truncated text ends up in the paste buffer, at least using Firefox 3.6.24 under Mac OS 10.5.8 Leopard.</p>

<p><code><pre><br />
-- field the drop event<br />
on open argv<br />
	<br />
	-- Make the file names into strings containing quoted POSIX file names, and concatenate them with spaces between.<br />
	set shell_argv to ""<br />
	repeat with arg in argv<br />
		set shell_argv to shell_argv & " " & quoted form of POSIX path of arg<br />
	end repeat<br />
	<br />
	-- Our Perl script is droplet.PL in the Resources directory of the application bundle.<br />
	set perl_script to quoted form of POSIX path of (path to resource "droplet.PL")<br />
	<br />
	-- Run the Perl script. The file names appear in @ARGV. Its output to STDOUT is captured in result.<br />
	set result to do shell script perl_script & shell_argv<br />
	<br />
	-- Display a dialog containing the result.<br />
	display dialog result as string<br />
	<br />
end open<br />
</pre></code></p>]]>
        
    </content>
</entry>

<entry>
    <title>Astro-satpass - The end of the chapter, but not the story</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/tom_wyant/2011/07/astro-satpass---the-end-of-the-chapter-but-not-the-story.html" />
    <id>tag:blogs.perl.org,2011:/users/tom_wyant//506.1949</id>

    <published>2011-07-07T02:20:08Z</published>
    <updated>2011-07-07T14:42:44Z</updated>

    <summary>The Astro-satpass distribution contains classes to compute satellite position and visibility. The recent &#8216;Heads up&#8217; posts were the latest chapter in its life, and that chapter comes to an end with the release of version 0.040. The only code modification...</summary>
    <author>
        <name>Tom Wyant</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://blogs.perl.org/users/tom_wyant/">
        <![CDATA[<p>The Astro-satpass distribution contains classes to compute satellite position and visibility. The recent &#8216;Heads up&#8217; posts were the latest chapter in its life, and that chapter comes to an end with the release of version 0.040. The only code modification since the most-recent &#8216;Heads up&#8217; was to have the <code>satpass</code> script take advantage of the new <code>lazy_pass_position</code> attribute.</p>

<p>So who uses this distribution anyway? Since it is open source, the only users I find out about are the ones who write me &#8212; usually with a problem of some sort. Most of these represent an opportunity to improve the distribution, even if only to try to make the documentation a little clearer.</p>

<p>My impression from the correspondence is that most uses of this package are casual &#8212; hobbyists, interested amateurs, and the like. This is not to deprecate those users: I am one myself.</p>

<p>But it appears to be be in serious, day-to-day use in at least four places. These are:</p>

<ul>
<li><p>An European Space Agency subcontractor uses it to help his communications antennae acquire and track satellites, and to plan communications. No, this is not a real-time use of Perl; the antennae can track a satellite once it is acquired, but they need to be told where to start, and they need help to prevent their being hijacked by stronger signals.</p></li>
<li><p>A web service that provides notification of International Space Station overflights is in the throes of adopting this package to do its predictions.</p></li>
<li><p>A radio astronomer uses this package to monitor the positions of certain satellites so that he can plan his observing.</p></li>
<li><p>A meteorologist who needs to avoid satellite interference with his Doppler radar uses this package to know when the relevant satellites are above the horizon.</p></li>
</ul>

<p>Now, I have not quizzed any of these people over and above whatever their problem at hand was. But my impression is that only the first two are professional programmers. The last two are people in technical jobs of which programming is only a part.</p>

<p>I mention this last because there have been some posts recently about the market and mind share of Perl among professional programmers. But to what extent should our marketing take into account other sorts of users? I do not know the answer, but thought it might be useful to ask the question.</p>
]]>
        

    </content>
</entry>

<entry>
    <title>Heads up II - Astro-satpass modifications</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/tom_wyant/2011/06/heads-up-ii---astro-satpass-modifications.html" />
    <id>tag:blogs.perl.org,2011:/users/tom_wyant//506.1893</id>

    <published>2011-06-23T18:02:18Z</published>
    <updated>2011-06-24T06:49:18Z</updated>

    <summary>The Astro-satpass distribution contains classes to compute satellite position and visibility. If you are using it, please read on. If you think I should continue to deliver change notifications via this blog, please let me know, otherwise I will stop...</summary>
    <author>
        <name>Tom Wyant</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://blogs.perl.org/users/tom_wyant/">
        <![CDATA[<p>The <a href="http://search.cpan.org/dist/Astro-satpass/">Astro-satpass</a> distribution contains classes to compute satellite position and visibility. If you are using it, please read on. If you think I should continue to deliver change notifications via this blog, please let me know, otherwise I will stop doing so, and merely give notice via electronic mail.</p>

<p>On June 11 2011 I wrote about the changes to the <a href="http://p3rl.org/Astro::Coord::ECI::TLE">Astro::Coord::ECI::TLE</a> <code>pass()</code> method which were in release 0.039_04. The blog entry detailed those changes and expressed the intent to make another release in about two weeks.</p>

<p>A respondent questioned the performance of the <code>pass()</code> method when the <code>interval</code> attribute was positive. This attribute causes the <code>pass()</code> method to return periodic positions during the pass, as well as the significant events of the pass. Investigation revealed a serious inefficiency in this functionality, and turned up some more &#8220;edge case&#8221; pass prediction problems.</p>

<p>Because of the further changes to the <code>pass()</code> method, I have made another development release: 0.039_05. I intend to allow another two weeks for evaluation and feedback before making either another development release (if further issues turn up) or a production release (if not).</p>

<p>The specific problems fixed in this release are:</p>

<ul>
<li><p>Versions 0.039_03 and 0.039_04 occasionally reported passes which ended shortly before the prediction interval started.</p></li>
<li><p>Versions 0.039_03 and 0.039_04 sometimes calculated the wrong max time. Again.</p></li>
<li><p>Passes in progress when the prediction interval started were still sometimes being missed if the <code>visible</code> attribute was false.</p></li>
<li><p>The calculation of positions periodically during the pass (controlled by the <code>interval</code> attribute) was anywhere from slightly slower to horribly slower than it needed to be. Also, the illumination reported for these positions was sometimes wrong. The re-implementation reports positions starting from the rise of the satellite. The original implementation reported positions starting from the start of the prediction interval, Since this was undocumented I feel justified in changing it, but since this is a development release I also feel justified in changing it back (which I think I can do without re-incurring the performance penalty) if someone is relying on the old functionality.</p></li>
<li><p>Added new attribute <code>lazy_pass_position</code>, which gives the <code>pass()</code> method permission to <em>not</em> calculate and report the position of the event. Currently, this only affects the periodic positions calculated in response to setting the <code>interval</code> attribute.</p></li>
<li><p>The <code>pass</code> command in the <code>satpass</code> script did not display periodic positions even when the <code>verbose</code> setting was true.</p></li>
</ul>

<p>The validation was again partially automated, so all I really know is how the code performs versus 0.039. Please let me know if you have any problems or concerns. I can be reached by electronic mail at <i>wyant at cpan dot org</i>.</p>

<p>Thank you for your time and attention,</p>

<p>Tom Wyant</p>
]]>
        

    </content>
</entry>

<entry>
    <title>Heads up: Astro-satpass modifications</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/tom_wyant/2011/06/heads-up-astro-satpass-modifications.html" />
    <id>tag:blogs.perl.org,2011:/users/tom_wyant//506.1844</id>

    <published>2011-06-12T00:38:23Z</published>
    <updated>2011-06-12T00:42:47Z</updated>

    <summary>The Astro-satpass distribution contains classes to compute satellite position and visibility. If you are using it, please read on. Recently Jaap Meijers wrote to me about some inconsistencies between the satellite visibility predictions provided by the Astro-satpass package and the...</summary>
    <author>
        <name>Tom Wyant</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://blogs.perl.org/users/tom_wyant/">
        <![CDATA[<p>The Astro-satpass distribution contains classes to compute satellite position and visibility. If you are using it, please read on.</p>

<p>Recently Jaap Meijers wrote to me about some inconsistencies between the satellite visibility predictions provided by the Astro-satpass package and the predictions of the Heavens Above web site (http://www.heavens-above.com/). This led to the correction of a number of bugs relating to the reporting (or not) of marginal passes by the Astro::Coord::ECI::TLE pass() method. These changes are currently available as release 0.039_04 of the Astro-satpass package.</p>

<p>This is the first time this specific method has been touched in quite a while, and I know that there are people doing real work with this code. So what I would like to do is to detail the changes and how they were tested, and give people an evaluation and feedback period -- a couple weeks, unless I get feedback that more time is needed. If additional problems are found, I will put out another development release, and repeat as needed. I can be reached by electronic mail at 'wyant at cpan dot org'.</p>

<p>The specific problems fixed are:</p>

<p>* Passes in progress at the beginning of the prediction period were not being reported, or being reported with an incorrect rise time.</p>

<p>* Visible passes which began during daylight were not being reported, or were being reported with an incorrect rise time.</p>

<p>* Passes which spent less than a minute above the horizon, or visible passes which spent less than a minute visible, were being sporadically detected.</p>

<p>* Passes which spent less than two minutes above the horizon, or visible passes which spent less than two minutes visible, were having their maximum elevation times incorrectly computed.</p>

<p>Initial testing was done on the passes which Mr. Meijers reported to be in error, and these have been incorporated into the formal test suite. This testing includes predicting appulses with the Moon, since I know the appulse functionality has real-world uses. Unfortunately I do not have permission to distribute TLE data needed for these tests, but the required OIDs and epochs are documented in t/tle_pass.t, and those with Space Track accounts can download the data.</p>

<p>In addition, I downloaded Dr. T. S. Kelso's "100 (or so) Brightest" (which at the time of download consisted of 152 objects), predicted both visible passes and all passes over the world's 40 most populous cities, and accounted for the differences between version 0.039 and 0.039_04.</p>

<p>No, I did not hand-validate the thousands of differences -- instead I used a Perl script to identify the differences and check the data produced by the pass() method for the circumstances that triggered the various bugs. According to this script all differences between 0.039 and 0.039_04 can be traced to bugs that have been fixed. Yes, I found (and fixed) two regressions during the testing; one involving the appulse functionality of the pass() method, and one involving missed passes which occurred near the end of the prediction period.</p>

<p>Please let me know if you have any problems or concerns.</p>

<p>Thank you for your time and attention,</p>

<p>Tom Wyant<br />
</p>]]>
        
    </content>
</entry>

</feed>
