Jay Harris's blog on coding .Net, automation, and improving quality through code. RSS 2.0
 Wednesday, September 19, 2007

I need to just make time to blog. I’m finding that I am getting behind, further and further, as the bleeding edge of technology pulls out ahead of me. [sarcasm]Keeping up to date is hard.[/sarcasm].

I am working on a few things to try to get myself back up to speed, beyond just the on-going procrastination over Microsoft .Net 2.0 certification. Last month, I attended Jay Wren’s talk on IoC with Castle at the Ann Arbor .Net Developers Group. Though we’ve been using Castle within our LMS for a few months now, patterns is definitely one of my weak points in developer-land, so I did pick up a few concepts on Dependency Injection. It was a great talk, and I got some swag!

Last week it was back to AADND for Michael Wood’s talk on Windows Workflow Foundation. I haven’t had much any exposure to Windows Workflow Foundation other than to not call it WWF. This stuff blows me away, and makes me even more jealous that we haven’t converted the LMS out of .Net 1.1. I wish I could have made it to the GANG meeting tonight on WF, just to learn more.

Tomorrow is another meeting, and another “Geek Fest” as my wife so lovingly refers to it as. Heading west to MSU for GLUG’s meeting on C# 3.0 by Bill Wagner. There’s going to be a bit on Code Rush, too (I love CodeRush!). Maybe I’ll win more swag!

Wednesday, September 19, 2007 9:10:30 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
Mush
 Friday, June 22, 2007

CruiseControl.Net 1.3 was released this morning. To me, most important was the new Build Queue functionality, stopping multiple projects from building at the same time. If ProjectB depends on ProjectA, and they both get code changes committed at the same time, they will fail from contention. Either ProjectA will fail because it can’t delete its old assemblies (because ProjectB has a lock on them) or ProjectB will fail because it can’t find the ProjectA assemblies (because ProjectA deleted them in its rebuild).

No more.

I’m so excited that I am already upgrading our servers!

Friday, June 22, 2007 9:19:30 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
Tools | CruiseControl.Net | Continuous Integration
 Thursday, February 08, 2007

All right. As mentioned before, here it is: I found a bug in mx.managers.DepthManager in Flash 8, though I’m sure it affects all ActionScript 2.0 versions of the DepthManager to date. The bug involves a lack of error handling when DepthManager encounters an object without a depth, or rather, without a getDepth() method. It shows up through any use of the DepthManager’s methods, the PopUpManager (mx.managers.PopUpManager), the Alert class (mx.controls.Alert), etc., when an object on the stage does not have a getDepth function.

What Happens?
The issue manifests itself in many variations, usually by objects placed with the DepthManager inexplicably replacing previous objects placed with the DepthManager. Most notably, it manifests itself as modal windows (via PopUpManager) and Alerts not rendering to the screen, even though the modality seems to have worked and all other objects on the screen no longer can receive input.

Why does this happen?
The DepthManager works off a rather inefficient array to maintain its records. An object within the DepthManager, the DepthTable, is an indexed array containing record of every object on the stage and its depth. The DepthManager stores a reference to the object within the array at the position corresponding to the depth of the object. If the stage has one object at a depth of 32,000, depthTable[32000] = myObject, and we have a 32,000-length array with one object stored in it [an inefficiency]. Values in the manager’s depth table are based on available positions in the array, such as kTopmost being greater than the last movieclip or object in the array [it iterates one-by-one through each position in our 32000-length array; another inefficiency].

Excerpt from mx.managers.DepthManager.as

var t:String = typeof(i);
if (t == “movieclip” || (t == “object” && i.__getTextFormat != undefined))
if (i._parent == this) {
depthTable[i.getDepth()] = i;
}

However, the DepthManager code is assuming that the object has a getDepth function. If the object does not have the function, references to that function return undefined, setting depthTable[undefined] = i, which blows chunks all over the place, and any reference to any of DepthManager’s depth-returning methods will always return zero.

That zero is why nothing works anymore; the Alert class creates the new Window-class-like object, then creates a transparent movieclip below that object to trap all inputs, creating a sense of modality. The Alert class uses the DepthManager to create itself at kTopmost, which DepthManager says is zero. The Alert class then uses the DepthManager to create the modality movieclip above itself, kTopmost, which it then hopes to swapDepth with to get itself back above the modality clip. However, the Alert class, with itself at depth zero, creates the modality clip at depth zero because DepthManager said it was the kTopmost depth. Creating an object at depth zero toasts any object already at depth zero, thus the modality clip blows away the Alert clip and we get a SWF that no longer responds to anything, and no Alert ‘OK’ button to restore peace in the world. Likewise happens when a modal window is created through the PopUpManager.

So what can I do about it?
How do you get around this? Simple. Don’t put anything on the stage that extends from Object. If you put it on the stage, extend it from MovieClip. Even though the DepthManager code (above) explicitly calls getDepth on MovieClip or Object, it does not check to see if the object in question actually has a getDepth method. Object does not have getDepth by default, but MovieClip does. I suppose you could write your own getDepth function for your Object-inheriting class, or you could rewrite the DepthManager (which would mean also rewriting PopUpManager, Alert, ComboBox, and a half-dozen other controls), but it is much simpler to extend from MovieClip.

Why it happened to me
I have a movie that is 170KB. There’s a lot of crazy mojo in there, and I want my prel0ader to load within the first 1KB, not after 170KB. So, I created my preloader, removed “Export in First Frame” from everything, and set my classes to export in frame 5 (after the end of my preloader loop). However, this made a few of my Object-extending components no longer work anymore since they were not referenced in the “Assets” layer of any of the other components (no reference=no load, much like the DataBindingClasses), to I had to drag them to the stage to ensure that they loaded.

*Poof*

My world exploded.

I lost two days of work tracking this little punk down. And you already know the rest of the story.

Thursday, February 08, 2007 10:23:12 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
Flash
 Thursday, October 19, 2006

The day is here: Internet Explorer 7 released this morning, though it is only available to users running Windows XP SP2 or Windows Server 2003. Though it does not yet appear on the list of available updates through Windows Update, you can download it from Microsoft.com. [ News: ZDNet | CNet ] In a CNet review, the reviewing editor notes how the browser is still not compliant with standards set by W3C and recommends switching to Firefox.

“IE 7 was Microsoft’s one chance to leapfrog ahead of the competition, but the company has only barely caught sight of the current front-runners. For more features and greater security, switch to Mozilla Firefox.” ~ CNet [ article ]

There is already a version branded by Yahoo! that includes the Yahoo! toolbar, links to Yahoo’s tools (like Yahoo! Mail), and the default homepage set to Yahoo. Of course, Yahoo! is catching some flak, since it released its “optimized” version prior to Microsoft’s own official release. [ ZDNet ]

Mozilla plans to release Firefox 2.0 in the coming weeks. You can download the current beta, Firefox 2.0 RC3, or the current public release, Firefox 1.5.0.7, from Mozilla.com. [ v2.0 RC3: download | release notes. v1.5: download | release notes ]

Thursday, October 19, 2006 9:39:24 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
Mush | Tools
 Tuesday, October 17, 2006

Both NAnt and NAntContrib released version 0.85 on Sunday. The changes to NAnt from 0.85 rc4 only include a few bug fixes. NAntContrib has added the ability to specify the encoding on SQL files. All-in-all, not much has changed since 0.85 rc4, but that is a good thing, since it indicates the version is finally ready for release. The first release candidate was made available nearly two years ago.

Despite the minimal changes in the final package, consider upgrading just to get rid of the ‘release candidate’ tag.

NAnt v0.85 [ homepage | download | release notes ]
NAntContrib v0.85 [ homepage | download | release notes ]

Tuesday, October 17, 2006 9:42:02 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
NAnt | Tools
 Monday, October 16, 2006

I’ve been working on creating a Flash component for within our LMS that allows a student to view their completion statuses in a curriculum, as well as allows managers to view the curriculum status of all of their students. The component relies on Web Services to volley data with the server. I was having some trouble binding data from my WebServiceConnector to my DataSets because, as it turned out, Flash was holding on to a cached version of the WSDL–a cached version that was ultimately obsolete.

I was on the hunt to find the source, and kill the evil cache file. After clearing out every Temp folder I could think of, I started playing around in my Local Settings folder and it turns out that Flash will forever-store cached copies of your WSDL deep within your ‘Documents and settings’.

C:\Documents and Settings\[user name]\Local Settings\Application Data\Macromedia\[your flash version]\en\Configuration\WebServices\

I just booted every file in the WebServices directory, but I am assuming that you could get away with just deleting ‘WSDLCacheMap.xml’, or if you want to keep the remainder of your cache, just delete the appropriate WSDL cache file (ex: WSDLkgzmcu.wsdl). In any event, once you have exercised your delete button, simply restart Flash and reload the WSC instance, and you will be good to go.

Monday, October 16, 2006 9:48:43 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
Flash
 Monday, October 09, 2006

For those that missed the announcement last week (like I did), the latest version of CruiseControl.Net has been released.

I plan on checking it out this week, then possibly upgrading our Build environment on Saturday. There are some modifications that I am really excited about:

  • Log4Net is used. (Default: Rolling file appender for logging server output.) If the traditional Log4Net configuration block is included in the application configuration file, I will probably change that to the ADONet appender, instead.
  • Users can volunteer to fix a broken build. How sweet is that!?!
  • <prebuild /> section allows custom tasks to run prior to the build. This one is a big bonus; previously, if something went wrong with the build, often the external log files (NUnit, FXCop) from the previous build would get included in the current build’s report. Now the prebuild can give them the boot.
  • Caching is used on WebDashboard. We have some huge log files and some not-so-powerful build servers. Sometimes it takes the machine a while to process the XSL. I am hoping that caching will help with that.
  • WebDashboard can stop and start projects. I am very excited about the ability to pause individual projects without having to modify the setup or stop the entire service.

This seems like a nice package (Release Notes). I am eager to pull it down and give it a go.

One gotcha that everyone should be aware of: Old versions of the dashboard and CCTray are incompatible with the new version of the service, so both will need to be replaced. Give your development team a heads-up, so they know to replace their tray installation as soon as the new server version is installed and online.

Monday, October 09, 2006 9:51:12 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
Continuous Integration | CruiseControl.Net | Tools
Navigation
Archive
<September 2007>
SunMonTueWedThuFriSat
2627282930311
2345678
9101112131415
16171819202122
23242526272829
30123456
Blogroll
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2008
Jason Harris
Sign In
Statistics
Total Posts: 64
This Year: 3
This Month: 1
This Week: 0
Comments: 1
Themes
Pick a theme:
All Content © 2008, Jason Harris
DasBlog theme 'Business' created by Christoph De Baene (delarou)