Archive for October, 2008
Simple Flex Builder Performance Tip
Posted by: | CommentsI wanted to put this little tidbit out for boosting Flex Builder’s performance on all platforms. I was ecstatic when I got my new desktop this past June (quad-core, 12MB cache, etc., etc.) and the build process flew. It was awesome (see complaints in previous post about my laptop seeming like a dinosaur in comparison), but as time went by it started getting more and more sluggish about building my apps.
There wasn’t any apparent explanation (except for maybe the fact that I was running Windows Vista with only 8GB of RAM) so it was a little disheartening. On the other hand I wasn’t seeing any performance decreases in any of my other “benchmark” apps (JBoss 4.2 startup in 10 seconds, NetBeans startup in 15 seconds, Photoshop CS3 in 8 seconds) so I got a little suspicious.
I did a little searching around and ran a few experiments, and came to realize that the more projects I had open, the longer it would take to build any one of them. When I started closing the projects, there was a corresponding increase in performance. This information allowed me to focus my search efforts and sure enough, Flex Builder will process every open project to see if it needs to be recompiled, and in the process compile the project you’re interested in.
So close some of those projects (right-click, or in case of a Mac two-finger-tap, and close).
My MacBook Pro
Posted by: | CommentsI’ve been needing a Mac for some time, if for nothing more than to test my AIR applications (I’ve run into a few quirks with some of the AIR specific features of Flex between OS X and Windows). The original plan was to get a Mac Mini this Christmas, until my brother told me he was selling his MacBook Pro. A few factors, namely the weak options available on the Mini, and the fact that my HP (circa 2005) has seemed slower than mud since buying my new desktop computer this summer, led to my wife allowing me to buy it.
I have now been a Mac owner for about 8 hours. I’ve used them before on a limited basis when the BYU CS department still had a Mac lab, but I just wanted to take a few minutes now and post a few obervations and thoughts I’ve had getting up and running.
It seems there’s a tradeoff between having a quiet notebook or having a cool notebook. My HP has a fairly loud fan (it’s actually pretty embarassing taking that thing out in the library) but it never gets hot. The MacBook feels like it’s about to spontaneously burst into flame. I haven’t owned the Mac long enough to decide which vice I prefer, but the loud fan was one of my bigger annoyances on the HP.
I discovered that “tapping” on the touchpad is disabled by default in Mac, which is funny because it’s generally enabled by default on most PC notebooks. A quick google search got me back in business (System Preferences -> Keyboard & Mouse -> Trackpad). And though I don’t like how dragging works: double-tap and drag, then wait a second for it to drop OR tap again; I do like the tap-with-two-fingers instead of the right click (on the PC you have to resort to the buttons to get a “right-click”).
One of my computers on the network has been recognized, but none of the others are there and I can’t figure out how to manually browse the network to set up some “mapped drives” or the Mac equivalent.
The final thing that’s screwing me up are the keyboard shortcuts. A lot of the common ones are similar between Mac and PC, just different enough to screw up whatever you’re trying to do. I’m not sure how I’ll work this one out– when I was fixing my touch pad I noticed where I could map my keyboard shortcuts. The problem is that I’ll be using a PC-type keyboard at home when I’ve got the MacBook plugged into my KVM, but I’ll be using the notebook’s keyboard when I’m at school and on the road. I guess I’ll see how this pans out in the next few weeks.
Overall I’m excited to see what happens. My plan now is to continue to use Windows and OS X, but I’m curious to see if one wins out over the other.
Book Review: Head First Design Patterns
Posted by: | CommentsHead First Design Patterns by Eric and Elizabeth Freeman was great. The designers of the series really tout their method of presenting the material as being on the cutting-edge, and although I can’t speak for everyone, the the content really got through to me.
I took a class a few semesters back that had design patterns as a core part of the curriculum, and it really opened my eyes as far as software development goes. We used the GoF book as our text, which is a very thorough, technical book that I have often been thankful to have in my personal library. I can’t deny that it comes up pretty dry when you’re trying to wrap your mind around a design pattern for the first time. There were a few design patterns we studied in the class (out of a total of about 20) that I left without having grasped well enough to where I felt I could apply it in real project (specifically the incarnations of the Factory patterns, with the exception of a simple factory).
The treatment of these patterns in HFDP really helped clear up a lot of the points I had struggled with before. Reading about the patterns I felt I understood already gave me an even better understanding. And the book is quite enjoyable, I’m not usually able to read “tech” books word for word.
I recognized a lot of the examples my professor used in class (which he borrowed from HFDP), and I remember him mentioning the book once or twice. I wish he had recommended it, because I probably would have benefited from it sooner.
At any rate I highly recommend this book, and will definitely try out a few more books from the series. I’ve already ordered HF Object-Oriented Analysis and Design, and HF Software Development (two other topics I “already know about”).
Angle Brackets in MXML
Posted by: | CommentsAfter using this blog theme for a few months, I should have known… When I was transferring some of the blogs from my CS 462 labs (which, incidentally, contained a lot of XML) I noticed that this theme was tenacious in the way it ate my angle brackets.
Apparently Flex Builder doesn’t like them either when you’re editing MXML (note: though I dislike the use of XML based syntax in a scripting language like ColdFusion, I don’t mind it as much for laying out visual components, which seems a short step from using HTML)… but I forget that MXML is in fact, XML and that there are some occasions when it doesn’t like you using angle brackets.
There are some exceptions, for example if you have the code (a > b) ? ‘x’ : ‘y’ inside a click handler, that is allowed. Don’t try to use it inside a label or a text attribute though. The good news is that because it’s XML, you can fall back to the good ol’ HTML escape sequences (i.e. > and <) when you need to display those characters.
Error #2044: Unhandled IOErrorEvent; text=Error #2038: File I/O Error.
Posted by: | CommentsI started this post a few months ago while I was working on an AIR application that uploads files to a remote server (by way of an upload script). I ran into this error, Error #2044: Unhandled IOErrorEvent; text=Error #2038: File I/O Error, which caused me considerable grief until I discovered the simple solution. I got the same error in an application I was working on today, and so decided to finish this post.
I looked up the problem when I first encountered it, and there seemed to be a consensus that the problem was due to using a bad URL for the location of the upload script. That was actually the case for me today, so I was able to fix it right away.
When I encountered the problem a few months ago, you could say that it was from using a bad URL, but it was much less obvious. I had written the upload script in ColdFusion, hosted on a CF server. I was certain that I had the URL typed correctly because I could access it in my browser. I discovered over an hour later that I had an authenticated session that allowed me to see it in the browser, a privilege not shared by the AIR app.
The problem was ultimately remedied by placing a special Application.cfc in the upload script’s directory that did away with the requirement for any session variables. This particular case may have been due to a combination of the CF server’s settings and the fact that I was using AIR, and not a Flex app that might have been served from the same server as the upload script.

