Sun, May. 11th, 2008, 12:05 pm
Wow, this AIR stuff really works

(yes, another AIR success story, but it's mine :-) )
My wife and I are lucky enough to get the same train in and out of the city, and it was on the journey home on Friday that she mentioned some work flow changes in her office. The upshot of these changes was that she was having to look at raw XML files many times a day.

I foolishly mentioned I could probably knock something up 'in a few hours' to make this a lot easier.And I could !
It was relatively trivial to get all the 'hard' stuff working - being able to just drag an XML file on to the application, for instance, was just a matter of following the LiveDocs. The same went for reading the dropped file into an XML instance to parse using E4X.

I seems hardly worth mentioning the fact that I developed it on Linux, but it's deployed to her Windows laptop, but that's always been one of the big selling points. And I knew technically it should work, but it was still fun seeing her run the .air file and it all just working.

No, you can't have the source. No, you can't have the binary.
It appears to parse a propiatary XML schema rather than, say, BizXML so it wouldn't be much use to you (as I can't give you the XML file it parses), sorry.

Instead, here's a screen shot and the key lines of code to take a dropped XML FIleReference and turn it into an XML object.

private function onDragDrop( event:NativeDragEvent ) :void{
NativeDragManager.dropAction=NativeDragActions.COPY;
var files:Array = event.clipboard.getData(ClipboardFormats.FILE_LIST_FORMAT) as Array;
for each (var f:File in files){
parseFile( f );
}
}

private function parseFile( f:File):void{
var data:FileStream=new FileStream();
data.open(f,FileMode.READ);
var str:String= data.readUTFBytes(data.bytesAvailable);
var xml:XML=new XML(str);
data.close();
}

 

AttachmentSize
ediViewer.png121.99 KB

Fri, Apr. 18th, 2008, 10:05 pm
Game over man, game over !

You should run, not walk, to the nearest Adobe Flash Player download page, and install version v9.0.124.

Note, this is not some small fry error about connecting to sockets, or cross-domain access like what was in the other recent update.
This is SKyNet Vs. Alien for the bragging rights over control of your computer.
From Flash (and therefore Flex too).

On (probably) any O/S with the v9 player.
Even Vista can not save you.

"Oops"

If you can, you might want to think about altering any HTML wrappers you maintain for Flash content to use Adobe's Flash Player upgrade systems by requiring v9.0.124 as a minimum. It's for the users own good.
SWFObject, for instance, supports this.

Thu, Apr. 17th, 2008, 10:05 pm
That looks wrong. I use GUIs too much, obviously...

I don't normaly do the whole 'meme of the week' thing, but I thought the one on Stuff That Happens was interesting.

falken@wopr:~$ history | awk '{a[$2]++ } END{for(i in a){print a[i] " " i}}'|sort -rn|head
63 ls
47 exit
38 cat
32 sudo
30 cd
20 svn
18 ssh
17 find
16 rm
16 bg
falken@wopr:~$

The server that runs our web sites and house intranet is only a little better. Can you tell I just log in to do stuff most of the time ?

[falken@bookcase ~]$ history | awk '{a[$2]++ } END{for(i in a){print a[i] " " i}}'|sort -rn|head
182 exit
152 su
123 ls
64 cd
43 locate
33 ps
32 top
30 mv
27 vi
20 rm
[falken@bookcase ~]$

Thu, Apr. 17th, 2008, 04:05 pm
Building ColdFusion services with ColdSpring and Reactor, part 5

If you're already familiar with AOP, or you've just finished the interlude reading, you will understand the way we can use ColdSpring to create a 'remote proxy' (or 'remote facade') that can act as the Service layer for a Manager. You've also maybe thought that this also allows cross-cutting concerns of the Service layer such as object type conversion and security to be cleanly addressed in a reusable way. These remote proxies use ColdSpring's RemoteFactoryBean class.

But before we can see how to use some common types of Advice to solve the problems we used to address in a per-Manager hand written Service CFC, I want to show you a handy way to bootstrap all your remote proxies as well as ColdSpring itself.
This will have the benefit that both remote Flex applications and local CFML applications can talk to the same service tier over the same API by connecting to what look like plain old CFCs. Also, as you have probably noticed, we don't need to write the Service layer ourselves any more - ColdSpring remote enables our CFCs automagically !

In 'tradditional' applications, there is always some aspect of application start up, defining constants in the application scope, creating the ColdSpring beanFactory and so on.
In an application based on AOP, 'all' that needs to be done is for each remote proxy CFC to be generated so it can be CreateObject'ed or used as a Flex RemoteObject end point.
You might rightly baulk at the idea of having to write a line of code for each Service, duplicating stuff from your bean config file, and then also having to remember to keep this startup code in sync with changes to your ColdSpring beans.
Enter com.falkensweb.aop.FacadeStarter !

The FacadeStarter is a simple CFC with one method, init(), that optionally takes the path to your bean config. file if it's not '/beans.xml'.
You make sure to call this method during application startup (say in the Flex applications HTML wrapper), or before any Service is used.
FacadeStarter will setup the BeanFactory (which you no longer need to worry about as a user of the service) and make sure all the RemoteProxies have been created.

FacadeStarter works by using the public ColdSpring API to find all the beans that are based on the RemoteProxy class, and calls getBean() for their name.
This creates a concrete CFC file on disk as defined by bean's config, Advice using and all.

FacadeStarter will not replace an existing beanFactory, so I commonly have a CFML file that removes everything in the application scope and calls the FacadeStarter again.
This is then run when ever a bean changes - recall beans in the BeanFactory are singleton's and cached for the life time of the factory. This applies to the underlying target bean of a RemoteProxy too.

The current version lacks several important 'weaponisation' features, such a locking around the creation to prevent half done BeanFactories being used by the application if multiple request arrive close together.
These will be added over time, or if you do so drop me a line with the code.

Previous Part 

Wed, Apr. 16th, 2008, 04:05 pm
The bug hunting process

Following on from their excellent GUI style guide, Stuff That Happens now presents their approach to bug hunting.

Thu, Apr. 10th, 2008, 04:05 pm
Proof ColdFusion rocks

I'm always saying how good ColdFusion is, and now we have proof that ColdFusion rocks.
Not that I'd ever party on a table, oh no... :-)

Wed, Apr. 9th, 2008, 10:05 am
Adobe fixes ColdFusion CFC remoting security bug

If you have ColdFusion 8, with CFCs exposed for remote access, with methods marked 'access="remote"' you probably did not know that this also meant any methods marked 'access="public"' could also be invoked remotely.

The obvious security problems now have a fix in the form of hot fix 71471 and it's associated KB article #40332.

You should apply this as soon as you can if your ColdFusion objects are being used by a Flex client, for instance.

Fri, Apr. 4th, 2008, 04:05 pm
ColdFusion 8.0.1 Updater, 64bit Linux Gotcha

Although the download page for ColdFusion lists several different Linux versions (SLES 9 and 10, for instance) if you end up at the actual support matrix for ColdFusion then only a limited sub set of that list is actually supported for 64-bit native (SLES 10.1 only for instance, not 9, and not any other version of 10).

Not that I've got it to run 64-bit native here yet, of course, but I've only tried a little bit and I'm not one to be put off by a piddling little thing like a floating point exception during "arch_prctl(ARCH_SET_FS, 0x2ad11b48ded0)" :-)

Thu, Mar. 20th, 2008, 08:05 pm
ITV pull out of Formula 1 coverage - good riddance !

Just heard on the radio that ITV didn't even bother trying to extend their contract to show Formula 1 in the UK, so the BBC (who actually, might, care) have got the rights back from next season.
All live. All uninterrupted. All online too. No more repeats of things like this.

Hurrah !

Tue, Mar. 18th, 2008, 10:29 pm
The only person to receive a knighthood for writing sci-fi

The only person to receive a knighthood for writing science fiction, Arthur C. Clarke, has died aged 90.

Although not surprising, it's still a shock to me that Sri Lanka's most famous resident has shuffled off this mortal coil.

Clarke got me, and many others, into sci-fi. With Rama I think. Maybe 2001.

Insert cunning joke about magic being advanced technology here :-/

I must do something tomorrow that involves a space elevator or a geosynchronous satellite.

Today is also the anniversary of the first space walk (43 years ago). Clearly it needs to be World Space Day from now on :-/

Tue, Mar. 18th, 2008, 04:05 pm
Flex 3 Schema for XML Editors

Because of the large changes in the MXML attributes from Flex 2 to Flex 3, it wasn't possible for me to spend enough time changing the Flex 2 Schema for XML Editors to support the new version.
Fortunately, there is no need for me to do so because the XSD4MXML project has one for download, plus source code to generate it yourself from Adobe's own source code.

The application is powered by a file called mxml-manifest.xml which you can find in the frameworks sub-directory of the SDK. One for Flex 3 is included in the downloadable code for xsd4mxml.
You should be able to use the same file from the Flex 2 SDK to produce an up to date and accurate version of my file too.

Using this file allows a (free) generic XML editor to verify your MXML code. If you don't have Flex Builder, this will be great news for you.

Tue, Mar. 18th, 2008, 12:05 pm
Adobe release pocket Flex 3 / AIR 1 reference for free under creative commons

If you are still waiting for your Flex Builder 3 posters to arrive, you could do worse than print out a copy of the 'pocket Flex/AIR reference Adobe just released.
At 20 double sided A4 pages it's a bit bigger than my pockets, but still makes a handy go-to book to keep on my desk - even printed on the plain old office printers the print is readable.
Page 4 has a handy 'show to people who ask what I do' diagram too :-)

Fri, Mar. 7th, 2008, 04:05 pm
Adobe DevNet article about CFEclipse

Adobe's ColdFusion Developer Connection has a nice article on CFEclipse, saying "If you aren't using CFEclipse, it's definitely worth a look. This article will introduce and get you started with using Eclipse and the CFEclipse plug-in as an alternative IDE".

Fri, Feb. 29th, 2008, 08:05 pm
I'm contributing to Flex

After joining the contributor list for Flex last week, it appears that I have the pleasure of saying that the first external patch to open source flex was mine - making it easier to build Flex on Linux (#SDK-14810).

I like to think of this as being an excellent statement on where and how Adobe is going about things :-)

And, of course, in a geeky way, I'm kinda proud too.

Thu, Feb. 28th, 2008, 02:05 pm
I'm going ? Are you going ?

Last years best ColdFusion conference, Scotch on the Rocks, is back in Edinburgh later this year !

I got so much out of last years, smaller, shorter and only slightly cheaper conference that work have kindly sent me again.

What will be said if you don't make it ?

Mon, Feb. 25th, 2008, 08:05 pm
BBC thinking of deploying Adobe AIR applications

According to an article on the BBC news website quoting the BBC's Future Media and Technology Journalism chief architect, the BBC is "currently building prototype versions of several applications such as the news ticker". The article goes on to say the news ticker would "displays headlines on a desktop". Another project is "mini Motty, which provides desktop football commentary".
The article goes on to cite the key benefits of AIR - namely it's cross platform and reuses some of the Flex/Flash skills the BBC already has used for their streaming iPlayer project.

Mon, Feb. 25th, 2008, 10:05 am
Using the Flex 3 Data Visualisation components with the Flex 3 SDK

For reasons best known to themselves, Adobe do not ship the trial Data Visualisation components with the SDK download, so you have to extract them from the Windows download yourself.

First, install the Flex 3 SDK:

#sudo mkdir /opt/flex-sdk-3
#sudo chown myUser /opt/flex-sdk-3

#cd /opt/flex-sdk-3
#unzip ~/flex_sdk_3.zip

Then, use VMWare or something to install Flex Builder 3.

Now you need to copy the following files from (the default location under) c:\Program Files\Adobe\Flex Builder\sdks\3.0.0 into the corresponding location under the SDK root:

# cp datavisualization_3*.sw* frameworks/rsls/
# cp datavisualization_rb.swc frameworks/locale/en_US/
# cp datavisualization.swc frameworks/libs/

 

Now you can use the new things like AdvancedDataGrid as well as the chart and other tools that were in Flex 2.

Mon, Feb. 18th, 2008, 08:05 pm
How to make your Eclipse plugin list survive an Eclipse upgrade

If you are playing around with the Linux version of Flex Builder, CFEclipse, or generally mucking about with your Eclipse, or need to upgrade to a new Eclipse version, you've no doubt been annoyed at the way this removes all your carefully installed plug-ins.
Fortunately there is a way to keep them across Eclipse re-installs.

All you need to do is create a few magic directories and one file:

# mkdir -p ~/eclipse-plugins/eclipse/features
# mkdir -p ~/eclipse-plugins/eclipse/plugins
# cat ~/eclipse-plugins/eclipse/.eclipseextension
name=My Eclipse Plugins
id=my.eclipse.plugins
version=1.0.0
#

Then in Eclipse itself, go to Help, Updates, Manage.
Right click the top of the tree, and choose Add, Extension location.
Pick the directory you created above.
Eclipse will want to restart so your should probably let it.

The next time you install a new plug-in, make sure on the final install screen you change the 'installation directory'.

The next time you have to blow away Eclipse, you can repeat just re-add the extension location to get all the plug-ins installed into it back, hurrah !

Wed, Feb. 13th, 2008, 04:05 pm
Using __type__ to return objects to Flex from ColdFusion faster

I've been playing with the method that seems to have been hiding from everyone for a while at http://www.briankotek.com/blog/index.cfm/2008/1/28/Returning-Typed-Structs-vs-CFCs-to-Flex
to generate arrays of value objects based on a query, but without using createObject().

You might want to search for '__type__' in
http://groups.google.com/group/transfer-dev/browse_thread/thread/0abdb2191dcfd226#2cbf827754e75376 and
http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=UseFlexDataService_05.html

The whole* community* seems to have discovered __type__ by accident (though it's in plain site in the docs !), and missed it during the big debates last year about returning VOs being slow. The basic idea is that the magic that sits between ColdFusion and a Flex client can use a struct key called '__type__' to tell Flex that this item isn't a struct, it's an object.

Below is a code snippet.
This is much faster than using CreateObject() for each array item, AOP (in ColdSpring) can of course be used to perform this conversion for you, every time you return a query.

<cfset res=ArrayNew(1)> 
<cfset props=arguments.result.columnlist>
<cfoutput query="arguments.result">
<cfset res[arguments.result.currentRow]=structNew()>
<cfset res[arguments.result.currentRow]['__type__']=variables.queryObject>
<cfloop list="#props#" index="prop">
<cfset res[arguments.result.currentRow][prop] = arguments.result[prop]
[arguments.result.currentRow] >
</cfloop>
</cfoutput>

Sun, Feb. 3rd, 2008, 12:05 pm
Applying Dell BIOS flash updates

There is a problem applying Dell BIOS updates to (at least) the PowerEdge SC440 and SC430 models:

# chmod u+x SC440-010500.BIN
# ./SC440-010500.BIN
Dell BIOS Update Installer 1.1
Copyright 2006 Dell Inc. All Rights Reserved.

tail: cannot open `+78' for reading: No such file or directory

gzip: stdin: not in gzip format

This is due to two problems - one is some weird POSIX stuff I don't begin to understand, and the other is because the BIOS updater is 32-bit, and my SC440 is 64-bit native, and so needs some weird 32-bit library.

So, here is what you need to do, as well as the instructions on Dell's web site ('init 1' etc.).

  1. Download the 32-bit 'zlib' library and install it.
  2. Follow Dell's instructions regarding run level 1, chmod etc.
  3. When you get to the step of running the updater, run this command first:

    export _POSIX2_VERSION=199209

  4. Continue as per Dell's instructions and watch the BIOS POST apply the update.

Why am I suddenly so keen on this ? Turns out there was an 'urgent' update late last year for the SC440, and the 'unoffical' Dell yum firmware repository doesn't carry it yet.

You can get all the really gory details and moaning at Dell's Linux support over on the Dell Linux-PowerEdge mailing list.

20 most recent