Archive for January, 2010

E4X: no > for you

Friday, January 22nd, 2010

In E4X (for actionscript 3), the “greater than” symbol is not always XML encoded as “>”.  However, the “less than” symbol is encoded.  While this looks odd, it’s actually valid according to the XML spec.

var bar:String="< wokka >";
var xml:XML =  <foo value= {bar} > The value is unbalanced </foo>;


trace(xml.toXMLString());


/*
<foo value="< wokka >">The value is unbalanced</foo>
*/

http://www.w3.org/TR/REC-xml/

The ampersand character (&) and the left angle bracket (<) MUST NOT appear in their literal form, except when used as markup delimiters, or within a comment, a processing instruction, or a CDATA section. If they are needed elsewhere, they MUST be escaped using either numeric character references or the strings ” & ” and ” < ” respectively. The right angle bracket (>) may be represented using the string ” > “, and MUST, for compatibility, be escaped using either ” > ” or a character reference when it appears in the string ” ]]> ” in content, when that string is not marking the end of a CDATA section.

In the content of elements, character data is any string of characters which does not contain the start-delimiter of any markup and does not include the CDATA-section-close delimiter, ” ]]> “. In a CDATA section, character data is any string of characters not including the CDATA-section-close delimiter, ” ]]> “.

Coming soon: Lizakowski Labs

Tuesday, January 5th, 2010

I’m creating another blog to show some of my technical side-projects and research. This covers everything from programming, to robotics, number theory, optics & lasers, circuit design, polymer chemistry, physics, psychology, economics, simulations, data visualization, and random experiments ala mythbusters.

Those who know me find these entertaining.  I figure that these random adventures should be shared.

At present, the design is not finished - I’m adding some content before we tweak it.  It’s also a lower priority than client work. But I expect it to be launched this month.

When it’s ready, it will be at http://labs.lizakowski.com

Using multiple iTunes accounts on the same desktop

Tuesday, January 5th, 2010

I’m trying to use multiple iTunes accounts on my mac.  Some things, like music, I want to purchase with my personal iTunes account.  Other things, like work-related apps, I want to purchase with my business account.  I only want one desktop, so these two iTunes accounts must work on the same desktop / mac login.  Some googling found conflicting advice on how to do this, but I think I’m close to arranging it.  Here is what I have so far.

iTunes only allows one account to be associated with a library.  However, if you hold down the alt key when starting iTunes, it let’s you select or create a new library.  I created one library for personal and one for work.

The next step is to associate each library with a different account.  This does seem to work.  However, my initial finding is that itunes tends to stick with one or the other.  So, for now, one has to logout as the first user and then login as the other user.

I’d like to see if I can get it to remember the association of library->account.  However, the situation does seem workable.

One caveat is that an iPod can only be associated with one account.  If you leave it plugged in and open the other iTunes library, it offers to nuke the contents and sync with the other library.  You can make the message go away, and I’m guessing you could undo the erasure by syncing with the original iTunes library.  In fact, that might be handy - if it works that way.  I’m not quite ready to try this, as I’ve only had the iPod touch for a couple days, but it’s on my list for experimentation.