How to Debug Fullscreen AIR Apps on a Secondary Display

Posted At : April 24, 2008 9:10 AM | Posted By : Cameron
Related Categories: Air

Like many developers, I have a dual monitor setup. I also have certain monitors that over time have become the "Home Display" for certain programs. I almost always write code on the left-hand display (my OS primary). Firefox and applications I am developing are virtually always on the right-hand display.

So I've been developing a full screen AIR app lately and have been irritated that the AIR application always wants to open on my primary display, thus covering my IDE and also covering any debug controls in Flex Builder. For awhile I moved Flex Builder over to the right-hand screen, but that just felt wrong, so today I figured out how to programmatically move the AIR app to the secondary display.

Turns out it just took one line of code (line 10 below), setting the stage's x coordinates to the righthand boundary of my primary display (which is also the left-boundary of my right-hand display). Now this might be old hat for Flash developers, but not for me. I thought I'd post a little mini-app example of making this work.

Note that your milage with this example may vary if you:

  1. Only have one display (it will move the AIR app out of your visible area)
  2. Your displays are setup to be above each other rather than beside each other (same result as 1)
  3. Your primary OS display is on the right (same again)

If you are looking to do something different with multiple displays, check out the Livedocs page for Enumerating the screens and the ASDoc for the Screen class.

UPDATE (10:20am)

Okay, so I thought better of my solution. This code does the same thing, but just moves the AIR app to the rightmost display. If there is only one display it will just stay there.

Nortel NetDirect VPN Problems on Vista - TapAdapter IP not Assigned

Posted At : April 22, 2008 8:22 AM | Posted By : Cameron
Related Categories: VPN,Security

Posting this for consumption by Google, so that when this happens to me again I can search Google and find the answer on my own blog. Then I feel silly. Then I am happy I solved my problem.

NetDirect is a Java based VPN client that requires a the installation of a little ActiveX control and then runs in the systray.

The Problem

I have two computers running this virtually identical Vista configurations. One works, one doesn't.

I'm on Vista Ultimate, and had tried getting NetDirect to work in both Firefox. Essentially, I got to the point where a little popup window opens up, I can see the NetDirect icon in the systray, and the client appears to be starting up. Then I get a long pause in feedback and an error. The output I see in the popup is as follows:

Downloading zip file...
Extracting zip file...
Loading library...
NetDirect: Initializing...
[[[ long pause here ]]]
NetDirect: TapAdapter IP not Assigned
NetDirect: Stopping...
NetDirect: Stopped!

At this point the window closes and the systray icon goes away. I tried a number of things including starting the browser "as Administrator" and also had searched Google for answers without any luck.

The Solution

The problem may have been due tot he fact that I already had installed (months earlier) OpenVPN to use a different client's VPN. As I was hunting around the system for the "TapAdapter" mentioned in the error message, I found a start menu option under OpenVPN that said "Delete ALL TAP-Win32 virtual ethernet adapters". Woah - that looked promising!

So I ran the bat file, it deleted some stuff, then I tried starting up the NetDirect connection again. Wham! It worked! Problem solved!

Note: I also started Firefox "As Administrator" when first installing the NetDirect client (it downloads and installs a couple of things). This may or may not have mattered.

How to Automatically Detect That Debugging Is Active in Production

Posted At : March 11, 2008 10:04 AM | Posted By : Cameron
Related Categories: ColdFusion

By now you should know that it's best practice to keep debugging turned off on production servers. Even when debugging is restricted by IP, ColdFusion busily goes about collecting debugging information for every page request, even though it's not displayed on the screen. All this extra activity tends to slow down the server a bit, particularly if you have "Report Execution Times" selected. Under load, having debugging turned on can have a serious impact on performance. Even in development, turning on "Report Execution Times" can have a significant impact if alot of developers are sharing one dev box.

So you know you should have it turned off in production, but inevitably you're going to need to debug something in production sooner or later, and turn that evil debugging switch back on for a moment. Occasionally you're going to forget to turn it back off. Occasionally the wrong person gets access to the CFAdmin and turns it on just because they don't know any better. However it happens - chaos, anarchy, and mass confusion are likely not far behind.

Wouldn't it be nice to be able to automatically detect that debugging it turned on and send yourself a notification or alert so you can shut it back off? Oh, but you can! Here are a couple of code snippets that you can drop into your Application.cfm or Application.cfc file to fire off an alert to yourself.

Or, if you want to get a little more complicated and detect that template execution times are being calculated (maybe on a busy dev box), you can try this one:

Both of these should work in CF6 and above, but I've only tested them on CF8.

How to Automatically Log Off Disconnected Remote Desktop / Terminal Services Sessions

Posted At : March 10, 2008 9:29 AM | Posted By : Cameron
Related Categories: Productivity

I've frequently heard complaints about people forgetting to log off when they end a Remote Desktop session. Instead they simply close the window, leaving their session running on the server. This orphaned session becomes a problem in many cases because Windows Servers are typically only licensed for two simultaneous logged in users. Even worse, if you can't remote into the box, you may not be able to easily identify the culprit(s) who left their sessions active. This leaves you no-one to throw things at and generally a very grumpy person.

Fortunately there is a solution to this problem...

You can configure Terminal Services to terminate abandoned sessions fairly easily on Windows 2000 and 2003 servers by doing the following:

  1. On the server, go to "Start > Programs > Administrative Tools > teminal Services Configuration"
  2. Select "Connections", then right click on RDP-Tcp and select Properties
  3. Select the Sessions tab and Check the "Override user settings" checkbox.
  4. Choose the criteria under which you'd like to start killing off sessions.

That does it!

High Scalability: 14 Best Practices From Yahoo

Posted At : March 10, 2008 7:59 AM | Posted By : Cameron
Related Categories: Scalability

Via the High Scalability blog, the Best Practices for High Scalability article and YouTube video presentation is worth checking out. Some of it's review, but there are alot of interesting metrics and data points in the video from Yahoo's Exceptional Performance Group. You may know you need to do certain things to make a site perform well, but those metrics can help you measure the real potential impact.

Note: There are some audio problems in the first couple of minutes of the video, but wait it out, it does get better.

Flex 3 Final - Run Air App and Nothing Happens

Posted At : March 7, 2008 9:44 PM | Posted By : Cameron
Related Categories: Air

I just ran into a somewhat frustrating to debug problem with running the final release of Flex builder. I just upgraded to the final release version of Flex Builder 3 from a beta version, and I found that suddenly my AIR projects would no longer run from the IDE. When I clicked the "Run As Adobe AIR Application" button - nothing happened. No error, no nothing, it just doesn't seem to do a thing. Then I tried running the running the app in debug mode and got this error:

Process terminated without establishing connection to debugger.

Command:

"C:\Program Files\Adobe\Flex Builder 3 Plug-in\sdks\3.0.0\bin\adl.exe" C:\wwwroot\MyApp\bin-debug\MyApp-app.xml C:\wwwroot\MyApp\bin-debug

Output from command:

invalid application descriptor: descriptor version does not match runtime version

After a little Googling around and hitting a few dead ends, I finally found the simple solution on this post on Brian Rinaldi's Blog. For any AIR apps you created in earlier versions of Flex builder, you're going to want to take a look sat the application's xml descriptor and make sure it matches the version of the AIR runtime you are developing for. Just open up the descriptor XML file and make sure that the namespace specified is "http://ns.adobe.com/air/application/1.0", not "http://ns.adobe.com/air/application/1.0.M6", which was the last beta version.

360Flex Atlanta Flickr Group Created

Posted At : February 26, 2008 1:58 PM | Posted By : Cameron
Related Categories: Flex

Quick post that I started a 360Flex Atlanta Flickr Group. Join and add photos. Or don't. Up to you...

Switch / NIC Auto Sensing Can Cause ColdFusion Server to Hang

Posted At : January 23, 2008 9:03 AM | Posted By : Cameron
Related Categories: ColdFusion,Standards

It was interesting to see a recent post on Joel Spolsky's blog explaining that a recent service outage in their hosting environment was caused by accidentally setting their switch to auto-sense network speed. In the post, he acknowledges that they do normally set the network speeds manually and turn off autonegotiate but that one switch had slipped through the cracks.

Leaving autonegotiate turned on can cause all sorts of sticky problems on a network because during negotiation a switch can drop packets. In an office network this is less noticeable, but in a high load environment it can really toss a wrench into the works.

In fact, as reflected in this post on the short lived CF-Guru blog you can see that this same setting can cause CF to potentially hang and depending on load, eventually fail.

So consider this a friendly reminder. In production environments, peg all the switches and NICs to a set speed.

Coworking in Atlanta

Posted At : January 3, 2008 11:57 AM | Posted By : Cameron
Related Categories: CoworkingAtlanta,Productivity

Working from home rocks! Working from home sucks! A lot of people I meet find out that I work from home and assume it's a nice fun thing to work from home all the time. It can be fun at times and it certainly gives me a little flexibility that I wouldn't have in a regular office job. However, it does have some downsides including lack of socialization and self motivation.

Don't get me wrong, I have some very productive days, but there are also days where you end the day realiseing that you didn't leave the house all day and maybe didn't even shower. That can be fun once and awhile but it can be a real downer to do regularly

After making a few posts to the ACFUG email list and a few friends who also work at home, a new word entered my vocabulary – "Coworking". Coworking is basically a gathering of people, sometimes in complimentary lines of work, who are all seeking a common place to do their work, bounce ideas off each other, and have some level of socialization.

So recently I've started looking round the interwebs looking for coworking places around the Atlanta area and so far I have found Jelly in Atlanta, which is a sort of informal Meetup group for coworking, and a Yahoo Coworking Atlanta Group which was started by Tim Moenk after he made this blog post about Coworking in Atlanta. Dean Saxe also sent me this great article about Office Nomads, which led me to find a great Google map of coworking spaces in the US.

Disappointingly, there is no very strong effort in any of those links that indicate anyone pursuing a serious dedicated coworking space in Atlanta. I'd love to see an intown space for coworking come into being so that I can have a little office space and social networking in the mix.

I've posted my name on the Jelly in Atlanta wiki but if there is anyone out there living in Atlanta who's also interested in coworking in the intown (specifically Imman Park) area, please feel free to drop me a line directly at cameronc@gmail.com.

Flex 360 In Atlanta February 25 to 27, 2008

Posted At : November 14, 2007 9:28 AM | Posted By : Cameron
Related Categories: Flex

It's official, the next Flex 360 conference will be here in Atlanta next February. Looks like it's going to be at the Omni Hotel, which is part of the CNN Center Complex of buildings.

I hope to go to this one since it's right in my own backyard!

More Entries

Recent Entries

Archives By Subject

Tech Blogs

(Mostly) Not Tech Blogs