2010.02.01

Top 3 roadblocks to purchasing an iPad

Disappointment is the best way to describe how I feel about the iPad. Such a promising and innovative device that has developmental problems before it is even born.

No I am not going to criticize Jobs for these choices. I can see the business logic behind every one of them so that is not fair.  He is after all running a business.    I will however include what I think those reasons are in this little rant (and why they are bogus).  So here goes … the top 3 roadblocks to purchasing an iPad

Keep reading →

2010.01.10

Flex Builder java.lang.StackOverflowError uncaught exception in compiler

Just posting this here for someone who might be having the same problem in Flex Builder 3 (eclipse).   The problem shows up as an the following error in the eclipse log file “java.lang.StackOverflowError uncaught exception in compiler”.  You get to this after you have an error in the problems panel that says…. “An internal build error has occurred. Right-click for more information.” It also might show up as the following pop-up.

What I found was the problem was that I had a class that was extending another class explicitly  as in Keep reading →

2009.12.01

More fun with regular expressions

I ( like many programmers I know) get just a little befuddled when trying to use regular expressions.  Over the years I’ve used numerous online RE parsers to test code.   Recently  I found a small RE parser that I absolutely love called “The Regex Coach”.

This little gem of a program  is great.  (As a bonus it is  free for both commercial and non-commercial uses.) Unlike other RE testers that I’ve used over the years, this one lets you actually step thru the parsing sequence and also see the execution tree of the RE.  These are very handy.  I find I am able to get to a functional RE statement in about a 1/4 the time as before.   You can get “The Regex Coach” from here.  http://weitz.de/regex-coach/

As a little bonus… here is a little gem of an RE statement (for field validation) for a field that must contain no value or one or more three digit numbers separated by commas.
(^(\d{3})(\,\d{3})*$)|(^$)

so in JavaScript the RE literal would be
/(^(\d{3})(\,\d{3})*$)|(^$)/

2009.11.27

Ext.iterate Array vs. Object Gotcha!

When calling Ext.iterate with an object the parameters passed back to the iterated function are:

(String key, Object value)

However when calling Ext.iterate with an array the parameters are:

(Object item, Number index, Array allItems)

The gotcha here is that in the Ext 3.0 docs only the object call back is shown.  Because of this you might think that the array call returns the index then the actual item bu as you can see that is not the case.

There is a thread on the Ext forum here about maybe making this consistent in the next major release.

2009.11.18

Beginings with Ext 3.0 JS library (combobox)

I started working on a project a few months ago that leveraged the Ext JavaScript  library for just a handful of features.  After some requests for some improvements in one section I decided to try to leverage a little more of the Ext library to improve it.  I decided to start just by redoing a form to use remoting.   Now I’ve done this kind of thing before  in all of the  the Adobe Action-script platforms ( Flex, Flash and Air)  so I am rather comfortable with the basic concepts.    I am also very comfortable with JavaScript having worked with it for over 10 years and using DHTML and other tricks (img src updates, etc.)  to do Ajax type magic before Ajax was even in the lexicon. I will say that some of the conventions used by JS developers drive me nuts… but that’s all formatting.   One really completely new area for me was JSON.  I’ve always wanted to try it so I figured this was the perfect opportunity.  So I started with a simple task on this one form.   Populate a single Combo Box remotely from a JSON datasource.  Now when I learn to program a new language (or library in this case) I need two things.   The docs and working examples.    On the documentation side of things Ext has a very good API documentation at http://www.extjs.com/deploy/dev/docs/ The one area I found lacking was in the way of simple examples.    One thing I always liked from Adobe documentation was the examples that were included the docs.   Always very simple and always just focused around the one object you were looking at.    Ext has provided some really nice sample applications at http://www.extjs.com/deploy/dev/examples/samples.html however it can be a bit hit and miss to locate the combination of examples that have the features you are looking for.   In particular I could not locate a single example that was just as simple as …. here is how you load JSON data into a combo-box.   I finally found a good one at  http://technopaper.blogspot.com/2009/11/dynamic-loading-of-combobox-using-extjs.html#comments I hope to leave some additional posts as I find bits and pieces here and there.

2009.10.13

Cast Number Conversion Exception

All strings being equal…:) this was one strange problem to figure out.

I was using the CF debugger in eclipse yesterday and my ColdFusion (CF8) code kept throwing the same debugger error on simple string equality statements such as : if( stringVar1 EQ stringVar2)

Here is the debugger error:

coldfusion.runtime.Cast$NumberConversionException
The value XX cannot be converted to a number.

castnumberconversionexception

It took a little digging to figure out what the problem was but I think I finally got it Keep reading →

2009.01.07

Regular Expression String to replace “&=”

So I have an issue where I need to move some CF8 code to a CF7 server. Unfortunately my code is littered with one of my favorite operators “&=” for string concatenation and this construct is not valid in CF7. In order to make my code work I need to convert all of my “&=” operators into var = var & string type statements.

Since I use FlexBuilder/Eclipse for my development I am able to take advantage of the advanced Find/Replace feature that uses regular expressions.

Here is the regular expression that I came up with to do my replacements.

Find: (^\s+)(.+)(\x26=)
Replace With: $1$2 = $2 \&

Here is a breakdown of what each part of each of these does

The Find string:

( starts capture group #1
^ matches the start of a line
\s matches white space
+ says to match ‘many’ of the previous char (white space)
) ends capture group #1

( starts capture group #2
. matches any character
+ says to match ‘many’ of the previous char (any character)
) ends capture group #2

( starts capture group #3
\x26 matches a char with hex code of 26 (ampersand)
= matches an equal sign
) ends capture group #3

The Replace string:

$1 Inserts capture group 1
$2 Inserts capture group 2
= Inserts and equal sign
$2 Inserts capture group 2
\& Inserts an ampersand (the \ is for escaping)

So the way this works is

Given the following line of code
stringVar &= ’some more text’;

  • Capture group 1 (^\s+) matches the start of the new line and the indentation.
  • Capture group 2 (.+) then matches to the var name “stringVar”
  • Capture group 3 (\x26=) then matches to the operator “&=”
  • Replace then inserts capture group 1 (the new line and indentation)
  • then it inserts capture group 2 (the var name “stringVar”)
  • then it inserts and equal sign “=”
  • then it inserts capture group 2 again (the var name “stringVar”)
  • finally it inserts an ampersand “&”

The final string becomes
stringVar = stringVar & ’some more text’;

Note that the expression only actually operates on the part of the line in blue and does not alter the rest of the line of code.

2008.11.10

Alternating between CF7 and CF8 running under IIS

Not sure if anyone else has a need for this information but I figured I would go ahead an post it just in case anyone might find it useful.

I know everyone knows that you can run both ColdFusion 7 and ColdFusion 8 on the same machine at the same time.   The common way to do this is to run one or both using the built in web server.  Now while this works I found that it is quite easy to switch IIS integration between ColdFusion 7 and 8 allowing both to run this way when needed.

I upgraded my local development environment to ColdFusion 8 about a year ago however my corporate development environment is still at ColdFusion 7.  90% of the time this is not a problem just as long as I am aware of what is and is not available.  (Mainly I have to make sure that I still use EQ, NEQ, GT etc…)    The one area that I found it necessary to have ColdFusion 7 for is for configuring the Flex / AMF gateway  (services-config.xml).

I do not have direct access to these configuration files on my corporate dev server (or ability to restart the server)  This is not usually a problem but can make for extra steps in this case.   In order for me to request a new channel or destination to be added to the config file I need to write it up and send it to the system administrator and have him add it and then restart the server.  Because to of the extra steps involved I have to make sure that it is configured exactly correctly.

When I was simply using CF7 on my local box I would just get a copy of the service-config.xml file from the dev server and then copy and paste the channel and destination sections from my local service-config.xml file and then send it back to the system administrator.  However now with CF8 my settings may not directly match.  First there is the issue that by default ColdFusion 8 splits the channel definitions and destination definitions into two separate files services-config.xml and remoting-config.xml.   OK not too big a deal however now I have to make sure to consolidate the settings into the one services-config.xml file for movement to the server.

OK Well to get back to my point.  I needed to be able to run both CF8 and CF7 as if they were the only version installed and running through IIS on my local box so that I could effectivly test these configuration files before sending them to our system administrator.    In the end my solution was to install both and switch between them.

The set up is not that difficult.  I first installed ColdFusion 8 using the default install path of C:\ColdFusion8\.  I then stopped the services and renamed the CFIDE directory in the Inetpub\wwwroot directory to CFIDE8.  Then I installed ColdFusion 7 to the default install path of C:\CFusionMX7\.   Then renamed the CFIDE directory it created in the the Inetpub\wwwroot directory to CFIDE7.   Then I pull the shortcuts each of the Web Server Configuration tools out of their respective start menu locations and put them on my desktop and renamed them so I would know which version applied to which.

Now to switch between them I just follow a fairly simple process… I stop IIS, and the version of coldfusion that is running.  Then I open up that version’s Web Server Configuration tool and remove IIS from the list. I close that Web Server Configuration tool and open the other version’s Web Server Configuration tool and then Add IIS to it.  Then I go into the Inetpub\wwwroot directory and rename the CFIDE directory that is there back what it should be (If i WAS running CF8 then CFIDE8) and then rename the other CFIDE? to CFIDE (say CFIDE7 to CFIDE)   Now the correct version of CF is connected up to IIS, the correct CFIDE directory is in place and I can just restart IIS and the appropriate ColdFusion server and now I’m running under the other version.

This set up is not as easy as running both versions concurently, however I found that I rarely did that anyway as it ate up system resources.  Once it is set up, this only adds a few steps to switching over from one version to the other and further I am running through IIS for both versions.

2008.09.03

Flash Window opening off screen

Here is a discription of the problem…

You have a laptop or other machine where you sometimes have 2 screens or monitors and at other times you only have one. Sometimes when you open the Flash CS3 IDE (more often when only using one screen but sometimes with both) The IDE or dialog boxes open way off screen. You can’t move it back and no matter what you do it won’t reset and just open on your primary (or only) screen.

The simplest solution I could find was to just delete the settings registry key

run regedit.exe and navigate to the following “folder”

HKEY_CURRENT_USER\Software\Adobe\Flash 9\Settings\

you should just be able to delete the Window value or reset it but this doesn’t always work for some reason. So just delete the whole Settings folder. Don’t worry Flash will rebuild it when you restart it. If this still doesn’t work delete the whole Flash 9 tree … again Flash will rebuild it when you restart it. (as always with regedit you should back up at least this part of the registry before messing with it… Don’t say I didn’t warn you.)

This fixed my problem… YMMV

If this post helps you… please leave a reply Thanks!

2008.06.03

Patent Issued

My first patent was issued today from the US Patent and Trademark office. Patent number 07380665 issued June 3, 2008.

3 on bucket

It might not mean a lot to many people but for as long as I can remember I’ve had ideas and inventions floating around in my head. A couple years ago I decided to start patenting my ideas…

Keep reading →