Get Outta my namespace (revisited)

November 18, 2007

Earlier, I discussed some of the problems/issues with Flex Builder’s default configuration of outputting the swf into the “bin” folder. (see Get Outta My Namespace). Operationally, the dot Net server’s claim to the “bin” folder in server root context was one of the roadblocks to use of the “bin” folder. It’s easy enough to use another name, to avoid conditions like this one.

Well, I was recently concerned with the performance of a web application, running on IIS on the JRun4 J2EE server distributed with ColdFusion. I decided to try running the application on a JBoss server, with ColdFusion 8, and do some performance benchmarking, and analysis, to see if the problem’s root was in JRun’s management of the memory objects, or in the tuning of the JRun server, or if the change in platform would make a difference at all. The performance problem is likely rooted in the application’s architecture, and the database configuration, but it was worthwhile and easy enough to see if there was any difference in changing the platform this way.

I have a JBoss 4.05 Server running Tomcat and ColdFusion 8, basically following the easy instructions at Steve Brownlee’s blog when I had first set it up with ColdFusion7, then updating it with ColdFusion 8, using the advice from Adobe. When I attempted to use the Flex application deployed in a “bin” folder which was *not* in the root, that is it was several subfolders away from the root, the server acted as if the html container and the swf file were simply not there. I tried several things before eventually simply renaming the deploy folder to “out”. Immediately, the server recognized the deployed html and swf. I haven’t yet determined what exactly is going on, but I know the bin folder has various application specific uses for JBoss and Tomcat. It seems as though this is interefering, once again, with the default “bin” folder output for Flex deployment. I’ve updated the project, locally, to build to “out” and mapped the application to “out” and it is all working just fine.

As for benchmarking performance, I have started. I’ll try to post anything interesting I might find.


CF8 in Notepad++ (Continued)

October 13, 2007

I’ve uploaded a new package to:

http://labs.soundrage.com/CF8NPP.zip

It includes a chm for CF8 help, the bulk of the size. It’s servicable, but the conversion from html to chm was not perfect.

It includes a script for Inno Setup, which I won’t be able to get back to for a while, so if someone is interested in picking that up, feel free. Otherwise, I’ll get to it when I get to it.  I have it kind of working but for a setup package, that’s really not good enough, and there is a lot more work to be done on it.

The key items of interest are:

1) The shortcuts.xml has a line for launching keyword sensitive help right from the editor to Adobe’s LiveDoc’s or to the local help file. I had to bump the php help off of the F1 key for my own setup, but feel free to do whatever you wish. CTRL-F1 and ALT-F1 launch the help, and highlight the keyword. The shortcuts.xml file needs to be in the folder with your Notepad++.exe, default is C:\Program Files\Notepad++\

2) The keywords themselves are identified in the a\apis\coldfusion8.api file.

3)  The (User App)\Notepad++\InsertExt.ini needs to contain regular expressions to mark the beginning and ending of a function, and how to pick out the function name.  These will show up on the function list, so you can click on the function name and jump straight to it.

[User Languages]
Count User Languages=2
Name 1=ColdFusion8
KeyWBodyBeg 1=
KeyWBodyEnd 1=
MatchCase 1=0
Count Comment 1=3
Comment P1.1.1=
Comment P1.2.1=
Comment P2.2.1=
Count Syntax 1=2
Syntax P1.1.1= Syntax P2.1.1=\"\t.*\>
Syntax P3.1.1=[A-Za-z]*
Syntax P4.1.1=
Syntax P5.1.1=
Syntax P6.1.1=
Syntax P1.2.1=cffunction[\t ]*name[\t ]*\=[\t ]*\"
Syntax P2.2.1=
Syntax P3.2.1=[A-Za-z_]*
Syntax P4.2.1=
Syntax P5.2.1=
Syntax P6.2.1=

4)  Finally, our old friend, UserDefinedlanguages.xml, needs ColdFusion8 set up inside of it.  Basically, you take the contents of UserDefinedLanguages_Coldfusion8.xml, and insert it into the appropriate area inside of the real/active UserDefinedLanguages.xml.  This also sits in the (User App) folder, which is, for me, C:\Documents and Settings\Howard\Application Data\Notepad++\, so yours will be something like that.

I’m posting this over with the Notepad++ people, and will followup there.

For InnoSetup, information can be found at:

http://www.istool.org/    – The extension to InnoSetup, which adds some good stuff.

http://www.innosetup.org/    – The base InnoSetup package.

Hopefully, it will be helpful to someone.  I just enjoyed the diversion for a few hours.


Linux for the Masses?

October 7, 2007

It wasn’t but five or six months ago that I was struck with the sense that it was doubtful that my next computer would be Windows based. There were several reasons for this, and I will try to sum it up quickly without sliding into the sanctimonious sophistry of the sheepherders, who bash Windows for breakfast. And first, I will say that I have some hope that Microsoft will step up and do something to save their products from continued decay, as they were once very good. But wishes are not horses. With internet explorer, Microsoft has had to make the bitter decision between backward compatibility and compliance with standards. A good strategist would have seen the third choice, but they didn’t have one on board when these decisions were made. In choosing to opt for backward compatibility, they have kept open a welcome mat, from the Internet, to an unacceptable number of security risks. I have seen way too many computers, in the past year, plagued with problems created by IE. And the add-on products which were supposed to lock things down failed to address these issues fully, and added problems of their own. Despite their performance in the courtroom, uninstalling IE is a chore.

It seems Microsoft’s concerns have drifted away from the user, and they have become focussed almost solely on their shareholder’s numbers. I noticed, with some chagrin, that the latest my file manager in windows now has a little menu option that says “Is this copy of Windows legal?” Yes, it is, Microsoft. I have the receipt. I have the license key. I’ve hit page down hundreds of times on your legal agreements that relinquish my rights to any sort of complaint for any problem you might cause, keeping an eye out for that clause about my first born, and intellectual property rights to my DNA.

More apropos, “Is this copy of Windows necessary?”

As a developer, I watch as more and more make the mass migration to Apple and OS/X. I have observed the same with non-developer users. And I have had the odious task of watching my wife suffer Windows Vista. The writing seems to be on the proverbial wall. The limits of the 32-bit operating system are being hit, the 4 Gig limit is no longer theoretical, XP64 or Vista Super Deluxe being the Windows options, it is going to be necessary to make an Operating system change in the coming months, regardless of Microsoft’s policies and corporate direction. Virtualization is another trend, which removes some of the barriers of switching operating systems.

The first thought was that I would switch to OS/X, Apple, Macintosh, and that still may happen. But the volume of Linux distributions has led me give it some consideration. A few months remain, maybe even a year, before I absolutely have to make a decision.

Linux options include, the most popular, Ubunto (based on Debian), targetted for the home desktop. Flavors include Kubuntu, Edubuntu, and XUbuntu.

Ubuntu 7.10 - Coming soon

Open Suse, another distro with Ease of Use as a goal:

Fedora, the Red Hat distribution, targetted more at the business desktop:

And a slough of others. If you haven’t, take a peek at DistroWatch:

http://distrowatch.com/


Flex Builder Plugin for Linux – Alpha

October 6, 2007

I was pretty excited to see that Adobe has Flex Builder for Linux on their labs page.

http://labs.adobe.com/technologies/flex/flexbuilder_linux/

I was wondering what I was going to do with all my free time. I run dual boot (dual hard drive) Windows XP and Ubuntu Linux. I have Eclipse set up, but it was at version 3.2, so I had to upgrade it to 3.3, make sure the classpath was set for Java 1.5. The following teminal line was helpful in keeping that manageable:

sudo update-alternatives --config java

Nowdays, with the package installers and all of the helpful people on the net, it does not take a rocket scientist to set up Linux (but it’s always nice to know one, just in case you run into trouble on re-entry!) and have XWindows running. The package installers aren’t 100% there, so there is always a little bit of file tweaking required.

Flex Builder Alpha for Linux

More later…


HTML embedded in Flex

October 6, 2007

This has been out in the wild for a while, but it is interesting to note that Flex can run inside of html embedded in Flex.  With AIR (Apollo) , the html inside of Flex problem has been more than solved, but some environments can’t or won’t run AIR on the desktops.

HTML in Flex

http://www.deitte.com/IFrameDemo3/IFrameDemo.html

http://www.deitte.com/archives/2007/09/html_in_flex_wi.htm


Flex build numbers using Ant and flexTasks

July 28, 2007

There are times when it is quite handy to be able to verify the version of a Flex Object which is loaded into the browser. These times include occasions when you think the browser is caching content (swf), when there is an errant build process, or when you are swapping a swf application, or even subcomponents in and out for testing some behavior. Having the Ant builder automatically set a build number and timestamp on the swf, by setting a public var with the values, allows you to put the value setting code in a single module, or in multiple modules and use the same mechanism.

To facilitate this with minimal disruption of the remainder of the code, it is handy to utilize the include directive for Flex builder/mxmlc. The import directive is so commonly used, that the include directive is often forgotten. Adobe Livedoc on include directive. Here is an example:

<?xml version="1.0"?>

<!-- example with Version.as -->

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">

    <mx:Script><![CDATA[

        include "Version.as";

        import  mx.controls.Alert;

    ]]></mx:Script>

    <mx:Button id="versionButton" label="Show current version"

               click="Alert.show(build_number + ' ' + build_time);"/>

</mx:Application>

And here is an example of a template Version.as.template file, prior to copying over to Version.as and replacing the @ tokens:

      public var build_number:String="@buildnumber@";

      public var build_time:String="@buildtime@";

Version.as file with @buildnumber@ and @buildtime@ tokens replaced.

      public var build_number:String="1.0.12";

      public var build_time:String="JUL 08 07 10:01 am";

Ant script to copy the template Version.as and then modify the result with the generated build number and buildtime.  Note that this requires a variable set up for modeldir  (the name modeldir is not important, it’s the path to the directory where where the Version.as file will be).

<taskdef resource="flexTasks.tasks"

         classpath="${ANT_HOME}/lib/flexTasks.jar" />

<target name="cvsbuild">

     <buildnumber file="mybuild.number" />

     <tstamp prefix="build"/>

     <tstamp>

         <format property="build.time" pattern="MMM dd yy hh:mm aa"

              offset="-1" unit="hour"/>

     </tstamp>

     <echo>Build Number ${build.number} ${build.time}</echo>

     <copy file="${modeldir}/Version.as.template"

              tofile="${modeldir}/Version.as" />

     <replace file="${modeldir}/Version.as"

            token="@buildnumber@" value="${build.number}" />

     <replace file="${modeldir}/Version.as"

            token="@buildtime@" value="${build.time}" />

</target>

The nice thing about setting vars like this, is it is possible to reach into any such object and pull out the version number for verification. This could be checked at runtime, or in your UnitTesting, or manually to follow up on a user reported issue.

Ant References: BuildNumber , tstamp, replace .


Degrafa – Flex Framework for Visual Elements

July 23, 2007

  When Flex was first introduced, there was, most prevalent, Cairngorm and Arp as support frameworks (Flex *is* a framework, don’t forget).  Both emphasized the data connection element, which was the biggest problem with Flash Remoting, so it makes a lot of sense.  Today, however, we are seeing a real need for the extension of some of that kind of methodology for the designer/graphics side of things.

  The Degrapha framework (http://www.degrafa.com/) promises to help ease some of the pain, or close the divide between the designer and the developer.  Called a “Declarative Graphics Framework” by its designers, Jason Hawryluk and Juan Sanchez, it provides support for re-use and extensibility on the graphics and visual side of the Flex development milieu.

  I took a moment this week to catch up on the Gausax framework developments (http://ablesa.wordpress.com/), and Angel Blesa has done quite a bit of good work there.  Check out the comparison of implementations of the Flex Store using no framework, Cairngorm, and then Gausax.  This treatment helps to easily see the difference.  The simplification of frameworks is what developers want, in order to remain Agile. 

  None of these is a case of replacing one thing with another.  There are benefits and strengths shown by each.  It is always a case of matching the solution with the problem, taking into account the complete context of the project at hand, customer requirements and the available resources.