Greg's Blog

helping me remember what I figure out

Ajax

| Comments

Garrett has published a little essay over at Adaptive Path discussing a new approach to building be applications: Ajax (Asynchronous JavaScript + XML). By his own admission this is not such an entirely new approach as anybody who has been using Gmail can attest too. It’s nice to see that it has gone mainstream now and is getting more attention. So for those keen on a little more information (courtesy of Jeff Veen’s blog):

Normal Service Is Resuming

| Comments

Four weeks after departing the cool shores of the UK for the warm climes of Australia we are back. Greeted by snow on our first day back at work. After the warmth, all I can say is too harsh…

ifModule

| Comments

Been meaning to post this for quite a while and a recent post on the BlueDragon mailing list reminded me to do so. Using the IfModule statement in your httpd.conf, you can check whether modules have been loaded and then carry out further configuration. Below is a sample of my httpd.conf for use with BlueDragon. [code] ServletExecInstances default 127.0.0.1:9999 ServletExecAliases default /servlet servlet .jsp .cfc .cfm .cfml SetHandler servlet-exec AddHandler servlet-exec jsp AddHandler servlet-exec cfc AddHandler servlet-exec cfm AddHandler servlet-exec cfml [/code]

Dynamic Text With Action Script

| Comments

Here’s how you can quickly create one or more text fields using ActionScript for you flash applications. I start off by defining the style (lines 2-6 in the code at the end of this post), which will be applied to the text fields. On line 8 a new text field is defined. The arguments for this method are follows: [as]movieClip.createTextField(instanceName, depth, x, y, width, height)[/as] Of note is the depth argument, because if you want to add more than one text field you need to increment that value by one, else every additional field will overwrite the current one. Thankfully there is a method: getNextHighestDepth() that will return the next possible value for you. The arguments that follow the depth one, set the display position and the width and height of your text field. The next three lines allow me to a) use HTML for my text, b) set the text to display (a link in this case) and finally apply the previously defined style. And this is then repeated for the second text field to be displayed (lines 13-16), making sure that the display position doesn’t overlap. // now create the dynamic text buttons fmtEmphasis = new TextFormat(); fmtEmphasis.bold = false; fmtEmphasis.size = 12; fmtEmphasis.color = "0x69889A"; fmtEmphasis.font = "Verdana"; this.createTextField(“tfNewfield1”,this.getNextHighestDepth(),0,0,150,20); tfNewfield1.html = true; tfNewfield1.htmlText = ”[ Link 1 ]”; tfNewfield1.setTextFormat(fmtEmphasis); // now create the dynamic text buttons this.createTextField(“tfNewfield2”,this.getNextHighestDepth(),170,0,150,20); tfNewfield2.html = true; tfNewfield2.htmlText = ”[ Link 2 ]”; tfNewfield2.setTextFormat(fmtEmphasis);

CFMX7

| Comments

Well I just got my hands on a copy of CFMX7 and like most CFML’ers eagerly proceeded to install the latest addition to the ColdFusion server family onto my windows development machine. This, sadly, turned out to be more painful than it really ought to be. Like many others, I encountered the “Please select another location to install to” after launching the installer. The root cause apparently a corrupted download. Hmm so much for first impressions. A couple more attempts at downloading the installer and still the same problem. Since I already had JRun 4 running on my dev machine I decided to try deploying cfmx 7 as a J2EE application and proceeded to download the jar file of CFMX7. This approach proved to be far more successful. One note to the unwary make sure the folder names where your JRun install may reside do not have spaces in them. The JMC may run fine but you instances won’t start up. Once downloaded simply double click on the downloaded jar file to start the process, which should start the installer. All this really does is create a CFMX folder with instructions on deploying CFMX 7 and the cfusion.ear file (if you chose the ear option when you ran the installer). Please note: I am not making use of RDS so these instructions don’t include hints for deploying RDS, the ReadMe generated by the installer covers this. All the instructions below can also be found in ReadMe I just mentioned.
  1. Go to the command line, and go to your directory that contains the EAR file you just created with the installer and make a new directory named cfusion-ear
  2. Change to the cfusion-ear directory and expand the cfusion.ear file with the jar command: “{path to Java home}/bin/jar -xvf ../cfusion.ear”. This expands the cfusion.ear file into cfusion-ear
  3. In cfusion-ear, make a new directory named cfusion-war and change to it, now expand the cfusion.war file using the jar command again: {path to Java home}/bin/jar -xvf ../cfusion.war
  4. Go back to your cfusion-ear folder, and delete the cfusion.war file
  5. Open the cfusion-ear/META-INF/application.xml file in a text editor and change the web-uri element from cfusion.war to cfusion-war. Save your changes.
Now you have a fully configured cfmx ear, which you can easily deploy on your J2EE server of choice. The process is the same as with creating CFMX 6.1 instances, i.e. (and I assume you are using JRun)
  1. Create a new server instance using the JMC
  2. Start the instance and then un-deploy the Flash Remoting EAR.
  3. Stop the instance again and navigate to the instance folder {path to Jrun}\JRun4\servers\{instance name}
  4. Delete default-ear and copy over your cfusion-ear
  5. Now restart your newly created instance and CFMX will be deployed.
Now all that you need to do is configure your instance to talk to your web server and you are done. As I said in the beginning, it’s not as smooth as it could be. The corrupted downloads really are a nuisance and really dampen an otherwise exciting prospect.

Ooh Skype

| Comments

I just re-installed everything on my home workstation and tried to install Apache 2.052 on it and the install kept failing while trying to install the service with the following message: [code](OS 10048)Only one usage of each socket address (protocol/network address/port) is normally permitted. : make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down Unable to open logs Note the errors or messages above, and press the key to exit. 10…[/code] Checked the list of services running, no sign of an httpd daemon, no sign of IIS. After a few botched attempts at un-installing and re-installing I remembered the netstat command and with the help of the following command: [code]netstat -ab[/code] I got a list of all ports that were in use and their associated applications. It turns out that Skype had bound to that address. I stopped Skype (if you haven’t heard of it, go check it out it’s a nifty Internet telephony ap) and installed the service again using: [code]apache -k install -n “Apache 2”[/code] Using the apache monitor I was able to start apache and it’s all working like a treat. BTW Skype by default listens on port 80 for “alternative incoming connections” you can uncheck this option quite safely as it should use the user defined port (which is apparently randomly selected at install time).

Big Pause

| Comments

There’ll be a long pause for the next month or so. By the time you read this I’ll be sat in plane on my way to Oz for a whirlwind tour taking in Brisbane, the Gold Coast, Melbourne, Wollongong and Perth, a couple of weddings and catching up with friends and family whom I haven’t seen for two years now. Needless to say I am very excited!

The Web Is a Small Place

| Comments

I have been reading Pepy’s diaries (on and off admittedly and between bouts of reading Stephenson’s Baroque Cycle trilogy) since I stumbled across it one bored afternoon at work in Sydney for nearly two years now and today I happened to be looking at friend’s blog (who now works with me in London), following a few links to other sites and to my absolute surprise it turns out that the man behind Pepy’s diaries is none other than her boyfriend. The world is such a small place sometimes.

Getting Started With UML

| Comments

Again another series of useful links and articles provided by some of our top cfers out there. Dough Hughes has dipped his toes into the UML and will be sharing his experiences. I for one look forward to reading his UML digests. He kicks off the process with his reasons for learning UML and what he intends to achieve and continues with an overview of what UML is all about. Sean Corfield supplements these two posts with a couple of links that he was made aware of by Jared Rypka-Hauer.

BD No Longer Running as Root

| Comments

A while back I blogged about instructions for changing the default user for BD, which is root, and finally got round to giving it a go. The links previously posted held all the information I needed, but since they were pretty elaborate, here in condensed form is what I did: [code] ugg:/home/gvs# useradd -d “/usr/local/NewAtlanta/BlueDragon_Server_62/” -c “BlueDragon CFML Server” -s /bin/sh -m bdragon ugg:/home/gvs# passwd -l bdragon ugg:/home/gvs# addgroup bdragon ugg:/home/gvs# chown -R bdragon:bdragon /usr/local/NewAtlanta/ ugg:/home/gvs# su bdragon ugg:/home/gvs$ /usr/local/NewAtlanta/BlueDragon_Server_62/bin/StartBlueDragon.sh [/code] And that should do the trick.