<?xml version="1.0" encoding="iso-8859-1"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>ptalk</title>
    <link rel="alternate" type="text/html" href="http://pt.withy.org/ptalk/" />
    <link rel="self" type="application/atom+xml" href="http://pt.withy.org/ptalk/atom.xml" />
   <id>tag:pt.withy.org,2008:/ptalk/1</id>
    <link rel="service.post" type="application/atom+xml" href="http://www.callitrope.com/cgi-sys/cgiwrap/trope/mt/mt-atom.cgi/weblog/blog_id=1" title="ptalk" />
    <updated>2008-05-07T20:24:33Z</updated>
    <subtitle>Random musings from ptw</subtitle>
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type 3.2</generator>
 
<entry>
    <title>Hot Date?</title>
    <link rel="alternate" type="text/html" href="http://pt.withy.org/ptalk/archives/2008/05/hot_date.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.callitrope.com/cgi-sys/cgiwrap/trope/mt/mt-atom.cgi/weblog/blog_id=1/entry_id=204" title="Hot Date?" />
    <id>tag:pt.withy.org,2008:/ptalk//1.204</id>
    
    <published>2008-05-07T20:19:43Z</published>
    <updated>2008-05-07T20:24:33Z</updated>
    
    <summary>Laszlo is previewing a Calendar module for its webtop. My first take: it works in the usual &amp;#8220;Laszlo-rific&amp;#8221; way you expect. I plugged in a couple of my .Mac calendars, and they &amp;#8220;just worked&amp;#8221;! Our Webtop family has grown to...</summary>
    <author>
        <name>ptw</name>
        <uri>http://pt.withy.org</uri>
    </author>
            <category term="Work" />
    
    <content type="html" xml:lang="en" xml:base="http://pt.withy.org/ptalk/">
        <![CDATA[<p><a href="http://www.laszlosystems.com">Laszlo</a> is previewing a Calendar module for its <a href="http://gowebtop.com">webtop</a>.  My first take:  it works in the usual &#8220;Laszlo-rific&#8221; way you expect.  I plugged in a couple of my .Mac calendars, and they &#8220;just worked&#8221;!</p>

<blockquote>Our Webtop family has grown to include a personal Calendar, a perfect complement to Laszlo Mail and Contacts. As we said earlier, Calendar is the most requested application and, while we&#8217;ve taken a lot of time to get this right, we have decided to release it a little early, as a Preview, because we want to know what you think.</blockquote>

<p><cite>
<a title="Introducing Laszlo Calendar" href="http://gowebtop.com/blog/2008/05/05/introducing-laszlo-calendar/">Introducing Laszlo Calendar</a>
</cite></p>
]]>
        

    </content>
</entry>
<entry>
    <title>Lighter than Air?</title>
    <link rel="alternate" type="text/html" href="http://pt.withy.org/ptalk/archives/2008/02/lighter_than_air.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.callitrope.com/cgi-sys/cgiwrap/trope/mt/mt-atom.cgi/weblog/blog_id=1/entry_id=203" title="Lighter than Air?" />
    <id>tag:pt.withy.org,2008:/ptalk//1.203</id>
    
    <published>2008-02-10T13:26:54Z</published>
    <updated>2008-02-10T13:27:52Z</updated>
    
    <summary>Who needs a MacBook Air? Well, I would sure love one as my ultra-portable. But, what if I could just add an external keyboard (and display? via an A/V cable)? BTKeyMini arrives this March, it will work with the iPhone...</summary>
    <author>
        <name>ptw</name>
        <uri>http://pt.withy.org</uri>
    </author>
            <category term="Wishes" />
    
    <content type="html" xml:lang="en" xml:base="http://pt.withy.org/ptalk/">
        <![CDATA[<p>Who needs a <a href="http://www.apple.com/macbookair/">MacBook Air</a>?  Well, I would sure love one as my ultra-portable.  But, what if I could just add an external keyboard (and display?  via an <a href="http://www.apple.com/ipod/accessories/">A/V cable</a>)?</p>

<blockquote>BTKeyMini arrives this March, it will work with the iPhone</blockquote>

<p><cite>
<a title="Macworld | Editors' Notes | Expo Notes: A Bluetooth keyboard for the iPhone?" href="http://www.macworld.com/article/131723/2008/01/btkeymini.html">Macworld | Editors&#8217; Notes | Expo Notes: A Bluetooth keyboard for the iPhone?</a>
</cite></p>
]]>
        

    </content>
</entry>
<entry>
    <title>Who&apos;s got the password?</title>
    <link rel="alternate" type="text/html" href="http://pt.withy.org/ptalk/archives/2007/11/whos_got_the_password.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.callitrope.com/cgi-sys/cgiwrap/trope/mt/mt-atom.cgi/weblog/blog_id=1/entry_id=202" title="Who's got the password?" />
    <id>tag:pt.withy.org,2007:/ptalk//1.202</id>
    
    <published>2007-11-10T12:18:05Z</published>
    <updated>2007-11-10T12:28:33Z</updated>
    
    <summary>So, in addition to my bizarre experience where I started selling DVDs on ebay that I did not own, I just had a company that I used to do business with email me and tell me that the company they...</summary>
    <author>
        <name>ptw</name>
        <uri>http://pt.withy.org</uri>
    </author>
            <category term="Thought for the day" />
    
    <content type="html" xml:lang="en" xml:base="http://pt.withy.org/ptalk/">
        <![CDATA[<p>So, in addition to my bizarre experience where I started selling DVDs on ebay that I did not own, I just had a company that I used to do business with email me and tell me that the company <em>they</em> use to manage their user accounts had had all their data stolen.  And that in that data was my email address and my password (yes, the usual password that I have used for years for everything, since I can&#8217;t remember passwords and it seems insecure to record them all on my laptop, which could be stolen).</p>

<p>Their bad for storing passwords &#8216;in the clear&#8217;.  The very least they could do would be to use the well-known mechanisms for storing passwords through a &#8216;one-way encryption&#8217; that makes it easy to check that the right password is being given, but very hard to figure out what that password is.  [Don&#8217;t ask me to explain more than that.  It&#8217;s some deep mathematical magic that has to do with bits of math beyond my fuzzy brain, and the fact that computers are still <em>relatively</em> slow, although if enough money is at stake, you shouldn&#8217;t rely on that.]</p>

<p>What to do&#8230;  In theory, the people with this stolen data could just go round the internet connecting to the usual places like Amazon, PayPal, EBay, etc. enter the email and password they have stolen and wreak all sorts of havoc on me.  Luckily, I don&#8217;t keep my credit card on file at these places.  I force myself to enter it each time I buy something.  Slows down the outflow of cash from my wallet &#8212; a little bit.</p>

<p>But, now seemed as good a time as any to try to be a little more cautious about the internet.  So, what I have been laboriously doing is going through my Keychain, searching for accounts where the login is my email address.  If you right click on one, you get a menu with a &#8216;Go There&#8217; action, which should take you to the site, where Safari should auto-fill in your login and password (assuming you have told Safari that it can do that).  Once logged in, I find the &#8216;change my password&#8217; page, then go back to Keychain and use File/New and click on the little Key symbol to get the Password Assistant.  I pick Letters&amp;Numbers and a length of 12, and copy that string.  I paste it into the new password field on the website, then I log out, and log back in (with my new password).  Safari should notice that you have a new password, and offer to save the new password for the web site.</p>

<p>Other than having to do this for every <strong><em>bleeping</em></strong> account I can think of that might cause me pain if someone broke into it, its a pretty simple procedure.</p>

<p>Now all my passwords are different, so I have less to worry about if one of these sites is as stupid as the one that gave away my old password.  It just means that I can&#8217;t log in to any of these accounts from someone else&#8217;s computer, since there is no way in the world I can remember these passwords any more&#8230;  Maybe if I am lucky, the iPhone will eventually get a keychain app that can sync to my computer.</p>

<p>If you are using Firefox instead of Safari, Firefox has its own keychain, under Preferences/Security/Passwords.  If you haven&#8217;t already done it, you need to tell it to use a Master Password, or anyone who can get to your computer can see all your passwords.  Once you do that, you should do a similar dance to give yourself different passwords for each site.</p>
]]>
        

    </content>
</entry>
<entry>
    <title>GMail IMAP on my iPhone</title>
    <link rel="alternate" type="text/html" href="http://pt.withy.org/ptalk/archives/2007/11/gmail_imap_on_my_iphone.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.callitrope.com/cgi-sys/cgiwrap/trope/mt/mt-atom.cgi/weblog/blog_id=1/entry_id=201" title="GMail IMAP on my iPhone" />
    <id>tag:pt.withy.org,2007:/ptalk//1.201</id>
    
    <published>2007-11-07T14:06:13Z</published>
    <updated>2007-11-10T12:29:24Z</updated>
    
    <summary>Here&amp;#8217;s how I did it. Slight variation on GMail&amp;#8217;s instructions: In Apple Mail, set my gmail/POP account to inactive. Create a new gmail/IMAP account. Under Preferences/Accounts/Mailbox Behaviors uncheck all the boxes to store messages on the server. (Because mail sent...</summary>
    <author>
        <name>ptw</name>
        <uri>http://pt.withy.org</uri>
    </author>
            <category term="Thought for the day" />
    
    <content type="html" xml:lang="en" xml:base="http://pt.withy.org/ptalk/">
        <![CDATA[<p>Here&#8217;s how I did it.  Slight variation on GMail&#8217;s instructions:</p>

<p>In Apple Mail, set my gmail/POP account to inactive.  Create a new gmail/IMAP account.  Under Preferences/Accounts/Mailbox Behaviors uncheck all the boxes to store messages on the server. (Because mail sent through GMail is automatically saved on the server, so Mail does not need to do it.  Drafts will get saved over and over as you write a message and not deleted [a bug Google should fix, IMO], Junk see below, and Trash you don&#8217;t want, since that will permanently delete messages [you might as well keep them all since Google allows it, you never know when you might want to search and find something you deleted].)</p>

<p>The easiest way to create the correct account on your iPhone is to re-sync your iPhone, under Info/Mail  selecting your new GMail/IMAP account and under Info/Advanced selecting Replace for Mail  Accounts.  This will correctly create a GMail/IMAP account on your phone.  You should double-check under Settings/Mail/(your GMail account)/Advanced that your Mailbox Behaviors all say On My iPhone, for the same reasons given above on why Apple Mail should be set to <em>not</em> save to the server.</p>

<p>Finally, Google does such a good job of junk mail filtering, I turn off Apple Mail&#8217;s junk mail filtering.  (This is my main reason for switching to GMail.  The iPhone does no spam filtering &#8212; by sending all my mail through GMail, I see nearly no spam on my iPhone now.)  If a message does sneak through, you can inform Google about it by moving the message from your InBox to the [GMail]/Spam folder.  Similarly, if you <em>really</em> want to delete a message (not just archive it), you can move it to the [GMail]/Trash folder.</p>
]]>
        

    </content>
</entry>
<entry>
    <title>Advice for the OpenLaszlo optimizer</title>
    <link rel="alternate" type="text/html" href="http://pt.withy.org/ptalk/archives/2007/08/advice_for_the_openlaszlo_optimizer.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.callitrope.com/cgi-sys/cgiwrap/trope/mt/mt-atom.cgi/weblog/blog_id=1/entry_id=200" title="Advice for the OpenLaszlo optimizer" />
    <id>tag:pt.withy.org,2007:/ptalk//1.200</id>
    
    <published>2007-08-01T13:49:22Z</published>
    <updated>2007-08-02T12:03:18Z</updated>
    
    <summary>Since the OpenLaszlo compiler does not do common-subexpression elimination, when you are trying to optimize things, pretend you are writing in 1985 C. Instead of: if (d.c[d.f]) d.c[d.f]( sd ) say: var f = d.c[d.f]; if (f) f(sd); Even better,...</summary>
    <author>
        <name>ptw</name>
        <uri>http://pt.withy.org</uri>
    </author>
            <category term="Dear Lazzie" />
    
    <content type="html" xml:lang="en" xml:base="http://pt.withy.org/ptalk/">
        <![CDATA[<p>Since the OpenLaszlo compiler does not do common-subexpression elimination, when you are trying to optimize things, pretend you are writing in 1985 C.  Instead of:</p>

<pre><code>if (d.c[d.f]) d.c[d.f]( sd )
</code></pre>

<p>say:</p>

<pre><code>var f = d.c[d.f];
if (f) f(sd);
</code></pre>

<p>Even better, when you find yourself having to write a null check, ask yourself if it would be cleaner, simpler, and more efficient to have the variable you are referencing not be nullable.  For instance, if a variable is an array, consider using an empty array for its initial value, rather than null.  This is a time/space trade-off:  if there are many operations on the array and the variable is almost always not null, it will be more efficient to use an empty array; if there are few operations and the variable is usually null, then not allocating the empty array is the better choice.</p>

<p>(In Javascript 2, you will have the option of declaring a variable to be of a particular type, and you will have the option of declaring whether or not that variable can also be null.  If you declare it not to be nullable, then the compiler will give you a compile-time warning if it cannot prove that the variable is never null, and it will insert the appropriate runtime check for you.</p>

<pre><code>// This can be null, you have to check before using
var uplinkArray: Array;

// This cannot be null, you have to give a valid initial value
var uplinkArray: Array! = new Array();
</code></pre>

<p>Even though we don&#8217;t yet support the type declarations, we can follow the pattern and be ready&#8230;)</p>
]]>
        

    </content>
</entry>
<entry>
    <title>iPhone, therefore iAm</title>
    <link rel="alternate" type="text/html" href="http://pt.withy.org/ptalk/archives/2007/07/iphone_therefore_iam.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.callitrope.com/cgi-sys/cgiwrap/trope/mt/mt-atom.cgi/weblog/blog_id=1/entry_id=199" title="iPhone, therefore iAm" />
    <id>tag:pt.withy.org,2007:/ptalk//1.199</id>
    
    <published>2007-07-23T21:47:36Z</published>
    <updated>2007-07-23T21:50:42Z</updated>
    
    <summary>So, I got one. (Did you think I wouldn&amp;#8217;t?) My justification: I wanted a new iPod, because it is too hard to find your place in an audio book on a shuffle. And I don&amp;#8217;t want to have to carry...</summary>
    <author>
        <name>ptw</name>
        <uri>http://pt.withy.org</uri>
    </author>
            <category term="Play" />
    
    <content type="html" xml:lang="en" xml:base="http://pt.withy.org/ptalk/">
        <![CDATA[<p>So, I got one.  (Did you think I wouldn&#8217;t?)</p>

<p>My justification:  I wanted a new iPod, because it is too hard to find your place in an audio book on a shuffle.  And I don&#8217;t want to have to carry an iPod and a cell phone.</p>

<p>I love it.</p>

<p>I love the fact that I can be driving, listening to my iPod, and &#8216;seamlessly&#8217; transition to a phone call and back. I love how easy it is to manage &#8216;call interupting&#8217;.  I thought I would never use the camera, but since I can <em>email</em> pix, and for free, it turns out I do.  We got lost on a bike ride the other day and maps saved our butt.</p>

<p>My wishes:</p>

<ol>
<li>Merged inbox.  Too painful to visit each of my (4) email accounts</li>
<li>Threads.  I am so used to them in Apple Mail, I get lost without them.</li>
<li><em>Real</em> IM, not this dumb-ass SMS impostor</li>
<li>GPS.  Don&#8217;t cell phones have to have GPS for 911?  Why can it not tell me where I am on the map?</li>
<li>.local addresses.  Why should it not understand <em>Bonjour</em>?</li>
</ol>
]]>
        

    </content>
</entry>
<entry>
    <title>Pizza, Beer and OpenLaszlo [Part Deux]</title>
    <link rel="alternate" type="text/html" href="http://pt.withy.org/ptalk/archives/2007/05/pizza_beer_and_openlaszlo_part_deux.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.callitrope.com/cgi-sys/cgiwrap/trope/mt/mt-atom.cgi/weblog/blog_id=1/entry_id=198" title="Pizza, Beer and OpenLaszlo [Part Deux]" />
    <id>tag:pt.withy.org,2007:/ptalk//1.198</id>
    
    <published>2007-05-16T18:50:58Z</published>
    <updated>2007-05-16T19:03:00Z</updated>
    
    <summary>Please join Laszlo Systems in San Francisco, CA for an evening of pizza, beer and OpenLaszlo development on Thursday, May 31st from 7:00-9:00 pm. In addition to meeting and mingling with other OpenLaszlo advocates, you will also be able to...</summary>
    <author>
        <name>ptw</name>
        <uri>http://pt.withy.org</uri>
    </author>
            <category term="Work" />
    
    <content type="html" xml:lang="en" xml:base="http://pt.withy.org/ptalk/">
        <![CDATA[<p>Please join <a href="http://www.laszlosystems.com">Laszlo Systems</a> in San Francisco, CA for an evening of pizza,
beer and <a href="http://www.openlaszlo.org">OpenLaszlo</a> development on Thursday, May 31st from 7:00-9:00 pm. In
addition to meeting and mingling with other OpenLaszlo advocates, you will
also be able to share your own OpenLaszlo success stories and learn the
latest Laszlo community news and product advancements.</p>

<p><em>WE&#8217;RE LOOKING FOR PRESENTERS!</em> <br />
OpenLaszlo Developers: We&#8217;d love to catch a glimpse at your latest
applications and projects. Each presentation should be technical in nature
with a demo included. 10 minute slots will be available from 7:30 pm -
onwards, and there will be a projector on site.</p>

<p><em>COST</em> <br />
Free. Pizza, beer and non-alcoholic drinks will be provided by Laszlo
Systems.</p>

<p><em>TO SIGN UP</em> <br />
Please register at the following <a href="http://www.laszlosystems.com/events/501">link</a></p>
]]>
        

    </content>
</entry>
<entry>
    <title>802.11Bra?</title>
    <link rel="alternate" type="text/html" href="http://pt.withy.org/ptalk/archives/2007/05/80211bra.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.callitrope.com/cgi-sys/cgiwrap/trope/mt/mt-atom.cgi/weblog/blog_id=1/entry_id=197" title="802.11Bra?" />
    <id>tag:pt.withy.org,2007:/ptalk//1.197</id>
    
    <published>2007-05-04T17:14:04Z</published>
    <updated>2007-05-04T17:14:53Z</updated>
    
    <summary>I just saw an ad for &amp;#8216;wireless bras&amp;#8217; Are these bluetooth or wi-fi? Where can I get a pair of wireless u-trou?...</summary>
    <author>
        <name>ptw</name>
        <uri>http://pt.withy.org</uri>
    </author>
            <category term="Play" />
    
    <content type="html" xml:lang="en" xml:base="http://pt.withy.org/ptalk/">
        <![CDATA[<p>I just saw an ad for <a title="Victoria's Secret - Wireless Bras" href="http://www2.victoriassecret.com/collection/?cgname=OSBRPNOWZZZ&amp;cgnbr=OSBRPNOWZZZ&amp;rfnbr=51">&#8216;wireless bras&#8217;</a>
  Are these bluetooth or wi-fi?  Where can I get a pair of wireless u-trou?</p>
]]>
        

    </content>
</entry>
<entry>
    <title>Undefined redux</title>
    <link rel="alternate" type="text/html" href="http://pt.withy.org/ptalk/archives/2007/04/undefined_redux.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.callitrope.com/cgi-sys/cgiwrap/trope/mt/mt-atom.cgi/weblog/blog_id=1/entry_id=196" title="Undefined redux" />
    <id>tag:pt.withy.org,2007:/ptalk//1.196</id>
    
    <published>2007-04-19T12:02:01Z</published>
    <updated>2007-04-19T12:21:30Z</updated>
    
    <summary>Gentle reader,

Sadly, JavaScript has _way_ too many ways something can be undefined, and the two cases you cite are not equivalent:</summary>
    <author>
        <name>ptw</name>
        <uri>http://pt.withy.org</uri>
    </author>
            <category term="Dear Lazzie" />
    
    <content type="html" xml:lang="en" xml:base="http://pt.withy.org/ptalk/">
        <![CDATA[<p>A reader from Maynard asks:</p>

<blockquote>
  <p>My understanding is that in js, if a variable is declared <code>var foo</code>, and then it is read without an explicit initializer or setter being called, the variable still has a value of <code>undefined</code> and an error is signaled. If that is so in all js dialects then I don&#8217;t see any reason why adding variable declarations [to a class declaration] should ever cause problems. I don&#8217;t see how it could affect inheritance, for example. Am I missing something?</p>
</blockquote>
]]>
        <![CDATA[<p>Gentle reader,</p>

<p>Sadly, JavaScript has <em>way</em> too many ways something can be undefined, and the two cases you cite are not equivalent:</p>

<ol>
<li><p>A global variable can not be declared at all.  If you reference it, it is an error.</p></li>
<li><p>A global variable can be declared and not initialized.  If you reference it, it is <em>not</em> an error, you will get as a value the sole member o the <code>Undefined</code> type.  (Note that <code>undefined</code> is not a JS literal like <code>true</code>, <code>false</code>, or <code>null</code>.  It is just a normal variable, that initially has an undefined value.  You can set it to have a different value, and probably break lots of programs.  I <a href="http://pt.withy.org/ptalk/archives/2005/06/dont_assume_undefined_is_undefined.html">recommend</a> using <code>void 0</code> as the best way to get the undefined value.)</p></li>
<li><p>A global variable can be declared and initialized to <code>void 0</code>.  This is indistinguishable from 2.</p></li>
<li><p>Note that global variables are just properties of the global object (typically bound to <code>this</code> at the top level, or <code>self</code> or <code>window</code> in a browser), so although it is an error to reference an undefined variable, if you ask for that variable as a property of the global object, it is not an error (and you will get the undefined value as a result).  [It is <em>not</em> an error in Javascript to ask for a non-existent property of an object. But, because this can be the source of bugs (a type-oh in your code), our debug compile does warn you when you make such a reference.]</p></li>
<li><p>If you want to know if a variable has been declared or not (without using try/catch or provoking a warning), you can use <code>hasOwnProperty</code> on the global object, or the <code>in</code> operator.  [For the global object, they are equivalent.]</p></li>
</ol>

<p>Here&#8217;s some examples illustrating the above:</p>

<pre><code>js&gt; foo
js: "&lt;stdin&gt;", line 2: uncaught JavaScript runtime exception: ReferenceError: "foo" is not defined.
js&gt; var bar
js&gt; bar
js&gt; var bletch = void 0;
js&gt; bletch
js&gt; bletch === bar
true
js&gt; this.foo
js&gt; this.foo === void 0
true
js&gt; this.hasOwnProperty('foo')
false
js&gt; this.hasOwnProperty('bar')
true
js&gt; 'foo' in this
false
js&gt; 'bar' in this
true
</code></pre>

<p>Now, that all said, your original question was about a class instance variable.  Classes are implemented as objects, so instance variables are properties.  It is  <em>not</em> an error to reference a non-existent instance variable.  There is still the tiny distinction that you can discover whether or not the variable has been declared or not using the <code>hasOwnProperty</code> method or the <code>in</code> operator.  If you can prove that no code tries to do that for the variable under consideration, and that the declaration will not shadow an inherited value, you  can assume that adding the declaration is safe.</p>
]]>
    </content>
</entry>
<entry>
    <title>EMI gets it</title>
    <link rel="alternate" type="text/html" href="http://pt.withy.org/ptalk/archives/2007/04/emi_gets_it.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.callitrope.com/cgi-sys/cgiwrap/trope/mt/mt-atom.cgi/weblog/blog_id=1/entry_id=195" title="EMI gets it" />
    <id>tag:pt.withy.org,2007:/ptalk//1.195</id>
    
    <published>2007-04-02T17:45:18Z</published>
    <updated>2007-04-02T17:47:22Z</updated>
    
    <summary> Apple and EMI announced today that they will be offering music without DRM protection for an extra 30 cents. Huzzah! Someone finally gets it. Give your customer a fairly-valued product and you don&amp;#8217;t have to treat them as criminals....</summary>
    <author>
        <name>ptw</name>
        <uri>http://pt.withy.org</uri>
    </author>
            <category term="Peeves" />
            <category term="Thought for the day" />
    
    <content type="html" xml:lang="en" xml:base="http://pt.withy.org/ptalk/">
        <![CDATA[<p>
Apple and EMI announced today that they will be offering music without DRM protection for an extra 30 cents.  Huzzah!  Someone finally gets it.  Give your customer a fairly-valued product and you don&#8217;t have to treat them as criminals.
</p>

<blockquote>
 iTunes customers will be able to easily upgrade their entire library of all previously purchased EMI content to the higher quality DRM-free versions for just 30 cents a song
</blockquote>

<p><cite>
<a title="Apple Unveils Higher Quality DRM-Free Music on the iTunes Store" href="http://www.apple.com/pr/library/2007/04/02itunes.html">Apple Unveils Higher Quality DRM-Free Music on the iTunes Store</a>
</cite></p>
]]>
        

    </content>
</entry>
<entry>
    <title>RIAA goes Phishing</title>
    <link rel="alternate" type="text/html" href="http://pt.withy.org/ptalk/archives/2007/03/riaa_goes_phishing.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.callitrope.com/cgi-sys/cgiwrap/trope/mt/mt-atom.cgi/weblog/blog_id=1/entry_id=194" title="RIAA goes Phishing" />
    <id>tag:pt.withy.org,2007:/ptalk//1.194</id>
    
    <published>2007-03-02T17:46:44Z</published>
    <updated>2007-03-02T18:52:38Z</updated>
    
    <summary>RIAA launches propaganda, lawsuit offensive against college students Unless the music industry wises up, it will be faced with a long and protracted battle that may end up alienating the next generation of music fans. The latest BS from the...</summary>
    <author>
        <name>ptw</name>
        <uri>http://pt.withy.org</uri>
    </author>
            <category term="Peeves" />
    
    <content type="html" xml:lang="en" xml:base="http://pt.withy.org/ptalk/">
        <![CDATA[<p><a title="RIAA launches propaganda, lawsuit offensive against college students" href="http://arstechnica.com/news.ars/post/20070301-8953.html">RIAA launches propaganda, lawsuit offensive against college students</a></p>

<blockquote>
Unless the music industry wises up, it will be faced with a long and protracted battle that may end up alienating the next generation of music fans.
</blockquote>

<p>The latest BS from the RIAA:  They send you a letter and offer not to sue you if you go to their web site and send them $1500.  Idiots.  It&#8217;s basically a &#8216;phishing&#8217; scam &#8212; they are hoping people will be stupid (or scared) and send them money, because it is not really worth it to sue you.</p>
]]>
        

    </content>
</entry>
<entry>
    <title>Order in the code</title>
    <link rel="alternate" type="text/html" href="http://pt.withy.org/ptalk/archives/2007/02/order_in_the_code.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.callitrope.com/cgi-sys/cgiwrap/trope/mt/mt-atom.cgi/weblog/blog_id=1/entry_id=191" title="Order in the code" />
    <id>tag:pt.withy.org,2007:/ptalk//1.191</id>
    
    <published>2007-02-04T22:00:02Z</published>
    <updated>2007-02-06T15:08:00Z</updated>
    
    <summary><![CDATA[A reader from San Mateo writes: I expected this to print the words of my phrase in order. It did not. What gives? lzx&gt; words = "The quick brown fox".split(" ") «Array(4)#55| [The, quick, brown, fox]» lzx&gt; for (var w...]]></summary>
    <author>
        <name>ptw</name>
        <uri>http://pt.withy.org</uri>
    </author>
            <category term="Dear Lazzie" />
    
    <content type="html" xml:lang="en" xml:base="http://pt.withy.org/ptalk/">
        <![CDATA[<p>A reader from San Mateo writes:</p>

<blockquote>
  <p>I expected this to print the words of my phrase in order.  It did not.  What gives?</p>
</blockquote>

<pre><code>lzx&gt; words = "The quick brown fox".split(" ") 
«Array(4)#55| [The, quick, brown, fox]» 
lzx&gt; for (var w in words) Debug.write(words[w]); 
fox 
brown 
quick 
The
</code></pre>

<p>Gentle reader,</p>

<p><code>for in</code> iterates over the &#8216;keys&#8217; of an object.  An array is just an object that happens to have (mostly) numbers as keys (and auto-maintains a <code>length</code> property that is one larger than the largest numeric key).</p>

<p>An object is just a <a href="http://en.wikipedia.org/wiki/Hash_table">hash table</a>, and there is no implicit order of elements of a hash table (Java has <code>LinkedHashMap</code> which preserves entry order for iteration, and <code>TreeMap</code> which sorts entry order for iteration, but Javascript is a simpler language).</p>

<p>If you want to iterate over an array&#8217;s entries in order, use <code>for (var i = 0; i &lt; array.length; i++)</code>.</p>

<pre><code>lzx&gt; for (w = 0; w &lt; words.length; w++) Debug.write(words[w]); 
The 
quick 
brown 
fox
</code></pre>

<p>If you want to iterate over an object&#8217;s keys in a particular order, you have to pull the keys out into an array, sort that array, and then iterate over that array:</p>

<pre><code>var keys = new Array();
foreach (var k in array) { keys.push(k); }
keys.sort(function (a, b) {
  return (a &gt; b) - (a &lt; b);
});
for (var i = 0; i &lt; keys.length; i++) {
  Debug.format("%s -&gt; %s\n", keys[i], array[keys[i]]);
}
</code></pre>

<p>The fact that any particular runtime iterates over object keys in any particular order reveals an implementation detail of their hashes, but if you write your code to depend on that you are setting yourself up for a fall. Most Javascript runtimes just happen to use particularly trivial hash implementations that give you the illusion the keys are iterated in order.</p>

<p>See also the yellow box caution <a href="http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Statements:for...in">here</a>.</p>
]]>
        

    </content>
</entry>
<entry>
    <title>Vacant email</title>
    <link rel="alternate" type="text/html" href="http://pt.withy.org/ptalk/archives/2006/10/vacant_email.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.callitrope.com/cgi-sys/cgiwrap/trope/mt/mt-atom.cgi/weblog/blog_id=1/entry_id=190" title="Vacant email" />
    <id>tag:pt.withy.org,2006:/ptalk//1.190</id>
    
    <published>2006-10-11T20:46:30Z</published>
    <updated>2006-10-11T20:48:42Z</updated>
    
    <summary>Vacation email === evil. Just say no. It goes wrong too often. No one is so important that we all need to know they are on vacation. If you are important to me, I had better have more ways to...</summary>
    <author>
        <name>ptw</name>
        <uri>http://pt.withy.org</uri>
    </author>
            <category term="Peeves" />
    
    <content type="html" xml:lang="en" xml:base="http://pt.withy.org/ptalk/">
        <![CDATA[<p>Vacation email === evil.  Just say no.</p>

<ul>
<li><p>It goes wrong too often.</p></li>
<li><p>No one is so important that we all need to know they are on vacation.</p></li>
<li><p>If you are important to me, I had better have more ways to contact you than by just email.  And I probably know you are on vacation already anyways.</p></li>
<li><p>Do you have a vacation phone message too?  I hope you have a good burglar alarm.</p></li>
</ul>

<p>Vacation mail is about as useful as the boilerplate .sig lawyers and brokers put at the bottom of their email telling me the dirty joke they just forwarded to me is privileged information and that if I am not the intended recipient it is my fault not theirs.</p>
]]>
        

    </content>
</entry>
<entry>
    <title>Free as in beer, Open as in source</title>
    <link rel="alternate" type="text/html" href="http://pt.withy.org/ptalk/archives/2006/10/free_as_in_beer_open_as_in_source.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.callitrope.com/cgi-sys/cgiwrap/trope/mt/mt-atom.cgi/weblog/blog_id=1/entry_id=189" title="Free as in beer, Open as in source" />
    <id>tag:pt.withy.org,2006:/ptalk//1.189</id>
    
    <published>2006-10-06T23:41:04Z</published>
    <updated>2006-10-06T23:41:53Z</updated>
    
    <summary> Please join Laszlo Systems in Chicago, IL for an evening of pizza, beer and OpenLaszlo AJAX development on Thursday, October 19th. Laszlo - Pizza, Beer and AJAX (Chicago)...</summary>
    <author>
        <name>ptw</name>
        <uri>http://pt.withy.org</uri>
    </author>
            <category term="Work" />
    
    <content type="html" xml:lang="en" xml:base="http://pt.withy.org/ptalk/">
        <![CDATA[<blockquote>
Please join Laszlo Systems in Chicago, IL for an evening of pizza, beer and OpenLaszlo AJAX development on Thursday, October 19th. 
</blockquote>

<p><cite><a title="Laszlo - Pizza, Beer and AJAX (Chicago)" href="http://www.laszlosystems.com/developers/community/events/event_061019.php">Laszlo - Pizza, Beer and AJAX (Chicago)</a></cite></p>
]]>
        

    </content>
</entry>
<entry>
    <title>Dear Petey</title>
    <link rel="alternate" type="text/html" href="http://pt.withy.org/ptalk/archives/2006/10/dear_petey.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.callitrope.com/cgi-sys/cgiwrap/trope/mt/mt-atom.cgi/weblog/blog_id=1/entry_id=188" title="Dear Petey" />
    <id>tag:pt.withy.org,2006:/ptalk//1.188</id>
    
    <published>2006-10-04T18:05:58Z</published>
    <updated>2006-10-04T18:28:45Z</updated>
    
    <summary>A reader from New Jersey asks: Is limewire legal? I heard on the news that the recording companies are going after folks for downloading songs that don&amp;#8217;t have documentation, such as ordered thru iTunes. $750 per song. You should read...</summary>
    <author>
        <name>ptw</name>
        <uri>http://pt.withy.org</uri>
    </author>
            <category term="Thought for the day" />
    
    <content type="html" xml:lang="en" xml:base="http://pt.withy.org/ptalk/">
        <![CDATA[<p>A reader from New Jersey asks:</p>

<blockquote>
  <p>Is limewire legal?  I heard on the news that the recording companies are going after folks for downloading songs that don&#8217;t have documentation, such  as ordered thru iTunes.  $750 per song.</p>
</blockquote>

<p>You should read my blog!  :)  <a href="http://pt.withy.org/ptalk/archives/2006/06/sharing_stealing.html">Sharing != Stealing</a></p>

<p>Here&#8217;s the deal:  Downloading is <em>not</em> illegal, even though the record
companies would like you to believe it is.  (Think about it:  if
downloading copyrighted material was illegal, you would not be able
to go to most of the websites in the world.  Nearly every web site is
copyrighted, but you can&#8217;t read it without downloading that
copyrighted information into your computer!)</p>

<p>What <em>is</em> illegal is making songs that you bought (which are licensed
to you for your personal use) or songs that you stole (which you have
no right to at all), <em>available</em> for downloading.  That is the same
as making copies of a movie or a book &#8212; even if you are giving them
away, you are infringing on the owner&#8217;s &#8220;copy&#8221; right.  That&#8217;s the law
today.  The record companies would like you to believe that it is
downloading that is illegal, because when you download a song for
free, they lose money.  But that is not what is illegal under current
law.  The only people they have successfully sued are people who are
&#8220;publishers&#8221;, who are making huge numbers of songs available for
downloading by others.</p>

<p>So, <a href="http://www.limewire.com">Limewire</a> (et al.) are not strictly illegal.  But if you operate
Limewire in its default mode, it <em>automatically</em> shares all the songs
that you have downloaded.  That&#8217;s what could get you into trouble.
You can turn that sharing off, and not get into trouble; but then you
become a &#8220;leech&#8221; in the Limewire community, and most people won&#8217;t
share with you any more.</p>

<p>The simplest solution:  Tell your kids to use <a href="http://click.linksynergy.com/fs-bin/click?id=*Nwu2DSF1Ww&amp;offerid=78941.10000013&amp;subid=0&amp;type=4">iTunes</a> or some equivalent legal service for purchasing their military-industrial complex endorsed pop pap.  That is legal, and the songs can be shared
legally on up to 5 computers, and you won&#8217;t get in trouble.  Although you will have very poor taste in music.</p>

<p>There are lots and lots of legal downloads
out there, although not of the current &#8220;Top 10&#8221;.  Many of the newer
bands put a lot of their concerts up for download for free.  Lots of
bands put up singles for free on their own web site.  <a href="http://click.linksynergy.com/fs-bin/click?id=*Nwu2DSF1Ww&amp;offerid=78941.10000013&amp;subid=0&amp;type=4">iTunes</a> has a
free download of the week.  <a href="http://www.salon.com/ent/
audiofile/">Salon</a> has a &#8220;Daily Download&#8221; where they review new bands and
always give one free sample.  And if you want to turn your kids into
&#8220;Dead Heads&#8221;, every concert the <a href="http://www.archive.org/search.php?query=creator:%22Grateful%20Dead%22">Grateful Dead</a> ever did is available
on line for free.</p>

<p>So, you shouldn&#8217;t have to use Limewire to build up your music
collection.</p>

<p>[I admit that when I have a single song that I want, and it is not
available as a legal download, I do fire up Limewire and look for it there.
I try to get it legally first, but if the copyright holder thinks they are going to force me into buying an 18-dollar CD for one song, they are deluding themselves.]</p>

<p>Oh, one other reason not to use Limewire:  Several of the record
companies routinely &#8220;poison&#8221; Limewire by putting out files with
titles that match the most popular songs.  But these files are not
songs at all.  They are sometimes just warnings (like <a href="http://news.bbc.co.uk/2/hi/technology/2962475.stm">Madonna</a>
screeching &#8220;Don&#8217;t steal my f*cking music!&#8221; over and over), sometimes
they are viruses that report back to the record company on your
activity, and sometimes they are pornography with a handy web link to
suck you into a porno web site&#8230;  Not always, but all of these
things have been reported.</p>
]]>
        

    </content>
</entry>

</feed> 

