Do not use a collection of flash.filesystem.File objects as a dataprovider

I’m sure someone will fill in the technical details in the comments (hint hint, AIR experts), but here’s what I ran into.

I’m building an image upload system, and I’m allowing people to drag & drop images onto the app for upload. When they drop the images, I put all the File objects into an ArrayCollection, and then I rendered previews in a giant TileList driven off that ArrayCollection. Now, I figured that might be a little intensive, but it was taking 5-10 seconds to scroll down one row. I figured that it was just beyond AIR’s capabilities to render these jpg files (they are 2-10MB each) that fast, even off the local file system. So, I switched my TileList to a List, but had the same problem, even though I was just displaying

When I had that result, I figured there must be something about the flash.filesystem.File object that was causing the problem. So, I created a shadow ArrayCollection that I filled with a custom object, FileLight:

package org.iotashan.file {
    public class FileLight {
        public var name:String;
        public var extension:String;
        public var nativePath:String;
    public function FileLight(name:String,extension:String,nativePath:String) { = name;
        this.extension = extension;
        this.nativePath = nativePath;

When I drove the TileList off of the ArrayCollection filled with FileLight objects, performance came back to acceptable levels. Feel free to use that code however you want.

Spellchecking in Flex

I just came across <spellcheck:*>>, a neat replacement for the TextArea and RichTextArea components. It provides client-side or server-side spell checking, along with custom dictionaries.

The best part is that it’s donation-ware, so just claim you built it yourself, it took a week, and pass your hourly rate along to the author*. Just don’t send them $5 and consider yourself even 🙂

*Don’t actually do this.

Moving to Mac: VPN

Before I had my Macs, I used the Microsoft VPN on one of my Windows servers to give myself access to the home network while on the road. It worked smoothly, and required little setup on the client machines.

While trying to eliminate physical machines in my house, one of the boxes set to get the axe was this Windows box. But how would I connect remotely?

Well, the answer, it turned out, took less than a half-hour to set up. I use IPCop for my firewalls (have for years, probably won’t switch to anything else, ever), and it turns out that someone has an OpenVPN plug-in for IPCop called ZERINA. A quick install and setup of ZERINA and I was ready to get my Mac connected. Then, I found a neat tool called Tunnelbick that provides a GUI for OpenVPN connections on the Mac. I found these instructions (scroll down to “MACINTOSH OSX:”) for setting it up with ZERINA, and they worked like a charm. After a quick run to McDonald’s a couple days later for their free WiFi via AT&T, I confirmed that everything was up, running, and working like a charm.

Moving to Mac: Keeping in touch with Windows

Ok, so I’m not 100% off of Windows, nor will I ever be. Unfortunately, some projects (even personal ones) require that I use SQL Server, and most require testing in IE. Combine that with the facts that I don’t consider myself a *NIX expert quite yet, and that I’ve already invested thousands in Windows hardware, and I’ll probably be running Windows servers for at least a few years to come.

So, how do I cope? First off, I have to sing the praises of VMWare Fusion. I’ve used Parallels, but was never really pleased with it. Yeah, it ran Windows, but it didn’t do it with much style. Once I compared the feature sets, VMWare came out to be a clear winner to me. It supports things that Parallels doesn’t, like guest OS support for multiple CPU’s, 64 bit, and (least importantly) limited support for DirectX 9.

How do I use it? Well, I’ve got a few VM’s set up on my Mac Pro… The first one is actually the VM that points to the BootCamp partition. That VM is for testing IE 7 and Vista, and general Windows computing. When in BootCamp, it’s for the rare gaming session. The next one is a XP Pro/IE 6 testing environment. It’s off a vast majority of the time, though. The last VM is a 2003 Server, running SQL Server and it’s tools. It stays on all the time, since it’s literally a server machine. It replaced a 6-year-old Celeron box that was just eating up electricity.

Also, I’m still finding that I need files off of my old Windows boxen, and OS X’s support of Windows networking fixes a vast majority of that. Sometimes I just need to look something up on my old computer or manage one of my servers, and luckily, Microsoft was kind enough to release the Remote Desktop Client for OS X. The interface for actually establishing connections isn’t quite as slick as it’s Windows counterpart (I wish it just kept a history of previous sessions), but otherwise it’s identical.

So, between Remote Desktop and virtual machines, I’m covered. Hopefully, though, I’ll be able to wean myself off of Windows completely with these tools, like a smoker and nicotine patches.

Moving to Mac: Keeping in touch with Windows, followup

So, it turns out that Amazon’s got a great deal on VMWare Fusion… $35 after rebate:

Also, two different readers (I have 2 readers?) pointed out a better RDP client, Chord. It’s still a Terminal Services/Remote Desktop client, but with such obvious features as multiple and saved sessions, and the ability to change the screen resolution by just resizing the window. I think this is going to replace Microsoft’s client for me.