Perl CPAN: Too much fail for one computer!

Failed Test                       Stat Wstat Total Fail  Failed  List of Failed
-------------------------------------------------------------------------------
t/anon.t                             2   512    ??   ??       %  ??
t/attribute_issues.t                 2   512     6   10 166.67%  2-6
t/autoclean.t                        2   512    ??   ??       %  ??
t/basic.t                          255 65280    ??   ??       %  ??
t/clean.t                            2   512    ??   ??       %  ??
t/import.t                           2   512     1    2 200.00%  1
t/inner_keywords.t                   2   512     6   12 200.00%  1-6

How on earth did t/import.t fail 200% of it’s tests?

DeliciousEmailShare

Quick “Shuffle” algorithm in JavaScript

I came up with a quick “shuffling” algorithm for JavaScript for a project I’m working on, and I’m just saving it here for future reference in case I need it again. Feel free to copy it if you need one too.

shuffle = function( list ) {
  var result = [];
  while( list.length > 0 ) {
    var i = Math.floor( list.length * Math.random() );
    result.push( list.splice( i, 1 ) );
  };
  return result;
}
DeliciousEmailShare

Setting an initial selection in a Flex ComboBox

There’s other (possibly more elegant) solutions out there on the web, but I came up with this today when faced with trying to set the initial “selectedIndex” of a ComboBox whose contents are populated dynamically.  Unlike HTML, it’s not as simple as just marking one of the “options” as selected, but fortunately, it’s not a lot harder.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
<mx:Script>
  <![CDATA[
    private function locateLabel( source : ArrayCollection, label : String )
    {
        for( var i=0; i<source.length; i++ )
        {
          if(source[i].label == label ) return i;
        }
        return 0;
    }
  ]]>
</mx:Script>
 
<mx:ComboBox dataProvider="{model.stateList}" selectedIndex="{locateLabel(model.stateList,model.address.state)}" />

This method triggers binding whenever model.stateList or model.address.state changes, and updates the combo-box position accordingly. To me this is a bit cleaner than sub-classing the ComboBox, which was the primary other method that I saw recommended, but I welcome other suggestions, if there’s an even easier method I’ve missed.

DeliciousEmailShare

Developing AIR applications on Ubuntu Part 1

I’ve recently been looking at developing a cross-platform application on my Linux system for eventual use on Windows and Macintosh.  AIR became an obvious choice, because it’s solid on Windows and Macintosh, and supports Linux pretty well as well. I’m still in the midst of development, but I thought I’d post some of my original thoughts on JS/HTML AIR development on Linux.

After deciding to develop on Linux, and on AIR, the first point that came up was whether to develop in HTML/JS or to use Flex.  Unfortunately, Adobe has made the decision not to support Flex Builder 3 fully on Linux, and the prospects for Flash Builder 4 don’t look good either, so the main reason to use Flex over HTML/JavaScript (namely, a kick ass development environment) isn’t really there in Linux.  I did check out the Flex SDK version 3 and 4 using Ant (and I’ll post some thoughts on that later) but overall, without Flex Builder, Flex Development on Linux is just less appealing.   Given that there’s some really good tooling out there in Linux for building HTML/JavaScript applications, I’ve decided to use that for my current project.

The first step to developing an AIR application is of course to download the AIR SDK from Adobe.  This is available as a download for Linux.  Extracting files from a tarball is probably pretty familiar to Linux users, but in case you aren’t familiar with it, I’ll give a short instruction set here.

  1. Download the file to your home directory (/home/<username>)
  2. Unzip the directory to your temp directory (mkdir /tmp/air/;cd /tmp/air; tar xvjf /home/<username>/AdobeAIRSDK.tbz2)
  3. Copy the AIR SDK to the “/opt” directory. (sudo mkdir /opt/air-sdk; sudo cp -r /tmp/air /opt/air-sdk/1.5.2)
  4. Create a symbolic link to the “current” AIR SDK (sudo ln -s /opt/air-sdk/1.5.2 /opt/air/current)
  5. Create a script to add the environment variables.
  6. 
    
    #!/bin/sh
    export PATH=/opt/air-sdk/1.5.2/bin:$PATH
    #!/bin/sh export PATH=/opt/air-sdk/1.5.2/bin:$PATH
  7. Setup your environment for your main username.  Basically, add to the end of your .profile file “source /opt/air-sdk/current/setup.sh”

At this point, you should verify (by opening a command window and typing “source ~/.profile”) that your profile is working.  If it’s not, fix it and try again.  Once you’ve got it working, log all the way out of your linux account, and log back in again.  This should make sure that any terminals you launch will have access to the AIR tools (ADL and ADT).

ADL

ADL is the primary debugging tool that you’ll use when developing an AIR application.  adl is a Java program, and takes as an argument the Application descriptor XML for an AIR application.

ADT

ADT is the primary packaging and package signing tool that you will use when “compiling” and “distributing” your AIR application.  The adt tool uses the same application xml descriptor as adl, and requires an SSL certificate.  You may generate your own “Self Signed” certificate, but it will be less trusted than a real SSL certificate. Finally, when packaging an application using adt you MUST be connected to the internet.  ADT verifies the current date with several known timeservers to validate that the certificate is current and not expired.  If you are not connected to the internet, ADT WILL fail.

Next time I will get into a description of my project structure, and how to work with the HTML and JavaScript files that make up the AIR application

DeliciousEmailShare

I just want a pretty picture…

Several years ago, I had a Capital One credit card which had Van Gogh’s “Starry Night” as the background image.  It was my “Gas” credit card, that I would put all of my gas on, and since I had a 30 mile commute each way, I got to see it pretty often.  My “Starry Night” credit card was a little piece of joy that I got to see whenever I filled up my tank, helping to lighten up my otherwise annoying task of filling up the gas tank.  A few months later, one of my other card companies (Providian) offered to give me a customized card with Seraut’s “Sunday Afternoon on the Island…” and thus, I was on my way to having a wallet full of impressionist paintings.

Unfortunately, when my Capital One card expired, they sent me a new one with the plain Capital One background, and when I called to request the Starry Night background again, they said that wasn’t available with my card.  I grumbled a bit, but gave up after a while.  The next year, my Providian card followed suit, and so I gave up on my dream of carrying the works of the masters in my pocket.  It was allayed a bit when my wife (then girlfriend) picked me up a “Starry Night” skin for my laptop from Gelaskins but I’ve still been annoyed about the whole situation for at least 4 years.

Recently however, I noticed in my Wells Fargo account that I could request a custom design on my Wells Fargo bank card.  “Fantastic!,” I thought..  “I can finally get Starry Night back on one of my cards again.”  Reading over the guidelines, I noted that it would only accept images which you had the rights to personally.  “No problem, ” I think to myself, “Van Gogh died in 1890, and copyright at the time extended for the life of the author + 50 years, so Starry Night went public domain in like 1940, before I was even born.  I’ve got the rights to duplicate it.”  I browse over to Wikipedia, which has a photo of the painting, which, according to their licensing information is in the public domain because the copyright has expired, just as I expected.  So I download the image, send it to Wells Fargo, and submit it.  They say they will contact me within 5-7 days to let me know if my image has been approved.  “Horray,” I think.  “There’s nothing offensive about this picture, it should be a slam dunk!”

Unfortunately, 5 days later, I recieved an email:

Unfortunately, the design you selected does not meet our Image Guidelines. To select a new design, simply sign on at https://www.wellsfargo.com , click the Access Card Design Studio link on the Account Services page, and try again using a design that meets the following criteria.

 WELLS FARGO IMAGES GUIDELINES

 For all images you must:
 * Own the image or have permission from the owner to use the image on your card

Hrm.  I call the number included in the post, and ask to speak to the person who sent the rejection.  They’re unable to let me speak to that person, so I ask to speak to someone else in the card designer department, and they inform me that I can’t speak to anyone in that department.  I ask the person who answered why I’m not allowed to use the painting on my card.  They explain that I must have permission from the author of the artwork to have it on my card.  I calmly explain that the author has been dead for nearly 120 years, which makes obtaining permissions exceptionally hard.

“Fortunately,” I continue, “Copyright on the image expired in 1940, so it’s currently public domain.”

“But we need to have permission from the artist to use their image on a card.”

“He’s been dead for 119 years.  He isn’t in a state to give permission to anyone for anything.”

A short discussion with her supervisor didn’t yield any more progress, so I’ve decided to just submit the image over and over again until someone from Wells Fargo who is actually involved in the approval process contacts me.  I suspect it may take a while, but I just have to re-upload the image to their site once a week until they do.

DeliciousEmailShare

3D TV cometh

I saw a “glassless” 3D TV demo at The Bridge on Friday night when we went to go see Watchmen. Looked pretty cool, but there’s still plenty of kinks to be worked out, like viewable angle, and screen distance considerations. It looks like you still have to be sitting at least 5 feet away from the screen, and roughly centered, (though there appeared to be a “pocket” of space about 45 degrees off center that gave 3D too).

DeliciousEmailShare

Mozilla Prism

I took a look yesterday at Mozilla Prism. So far, i’m not particularly impressed, though I have to do a little more investigation into the webapp.js file and see what XPCOM stuff I can tap with it. As it stands, it seems like it’s just a simple way to open up a chromeless browser window from the desktop instead of having to click a bookmark. Largely uninteresting, when compared to things like Google Gears and Adobe AIR.

Tonight i’m going to tap the Google Gears libraries a bit and see if there’s anything in there that could be combined with Mozilla Prism to make something really cool.

DeliciousEmailShare

Not again.

So, after the Christmas 2003 incident, you would think my family would have the good grace to avoid Heart Attacks on holidays. Unfortunately, we apparently forgot to tell my grandfather. We got news this morning that he is in the Hospital in Minneapolis after suffering a heart-attack at some point last night. My uncle Gerry and my grandmother are there now, finding out more details. My parents, who are visiting my sister and I in California are looking into cutting their trip short and heading home today to be at his side, and to be there for him.

Apparently Grandpa Ness has been feeling “not well” for the last two weeks now, but he’s a stubborn old coot, and only sought out medical help on Tuesday or so of this week. I can only pray that he hasn’t let this go too long, and that this is just something that he can recover from, and learn a lesson from. Regardless, I’m looking into flights to Minneapolis right now, and figuring out what I need to do to be there.

DeliciousEmailShare

Google Groups

I’ve been fiddling around with Google Groups recently to communicate with my Roleplaying Game Group (Yes, i’m that kind of geek). I’ve been finding it very useful, and noticing one of the really nice hidden features: the “Page” editor. This page editor is basically a slimple CMS based on a standard “Rich Text Editor” sort of interface, but it’s very powerful for my small group to be able to document things without going through the trouble of a full blown Word/OpenOffice/RTF document, or trying to link in a Google Docs Document.

Expanding beyond my current use, I can see it being very useful for a small development group to store API Docs, Design Docs, Requirements, etc. Yeah, there are more powerful tools available, but this one works really well, and has just the sort of versioning capabilities that are useful without being obtrusive.

DeliciousEmailShare