Tuesday, January 31, 2006
Clock Time Regex
My own work:
^(0[0-9]|\d|1[0-2]):([0-5]\d)\s+(am|pm)$
This verifies if the time you put in matches the 12 hour clock. It works in every flavor of Regex, from the Perl/LAMP engine to the Java version to the Javascript version.
Below is a 24 hour version:
^([0-1]\d|\d|2[0-4]):([0-5]\d)$
If I get any comments to this blog, I'll add a seconds verifier.
^(0[0-9]|\d|1[0-2]):([0-5]\d)\s+(am|pm)$
This verifies if the time you put in matches the 12 hour clock. It works in every flavor of Regex, from the Perl/LAMP engine to the Java version to the Javascript version.
Below is a 24 hour version:
^([0-1]\d|\d|2[0-4]):([0-5]\d)$
If I get any comments to this blog, I'll add a seconds verifier.
Monday, January 30, 2006
What does deprecated mean?
Down here in Code Monkey land we see our languages of choice change over time. ColdFusion's classic example is the paramexists() function, which was replaced by the much better isDefined() function and CFPARAM tag. In essence, both of these things ably replace the clumsy paramexists() function, giving the developer more flexibility, and hence more power. The paramexists() function has been deprecated since 1999, and you simply can't rely on it to work anymore in our heady modern days of 2006.
And yet, people still use it and other deprecated operations. Partly I think because of inertia and partly because they never bother to check the deprecated function/tag/object list in their language of choice. In fact, the word deprecated is like the word 'obsolete'. People see it and use it anyway in our field.
The gist of all this is that today this bit me. My baby application has another connection hitting it. Way back in October I listed two searchable fields as being deprecated. I warned the developer responsible and everyone around him not to use these fields. And they were used anyway. And now the ship is about to break apart on the reef of life thanks to someone ignoring my documentation and direction.
Days like this make me wonder about the state of my chosen industry.
Down here in Code Monkey land we see our languages of choice change over time. ColdFusion's classic example is the paramexists() function, which was replaced by the much better isDefined() function and CFPARAM tag. In essence, both of these things ably replace the clumsy paramexists() function, giving the developer more flexibility, and hence more power. The paramexists() function has been deprecated since 1999, and you simply can't rely on it to work anymore in our heady modern days of 2006.
And yet, people still use it and other deprecated operations. Partly I think because of inertia and partly because they never bother to check the deprecated function/tag/object list in their language of choice. In fact, the word deprecated is like the word 'obsolete'. People see it and use it anyway in our field.
The gist of all this is that today this bit me. My baby application has another connection hitting it. Way back in October I listed two searchable fields as being deprecated. I warned the developer responsible and everyone around him not to use these fields. And they were used anyway. And now the ship is about to break apart on the reef of life thanks to someone ignoring my documentation and direction.
Days like this make me wonder about the state of my chosen industry.
Friday, January 27, 2006
Honor Roll Blues
Well, the kid was bragging last night that he is getting on the honor roll. He does admit he might get a 'C' in drama, which of course would prevent him from getting on the honor roll. So we are plain excited that after the scourge of lackluster grades last year, he is doing so well now.
So why my blues? Heh heh.
Well, he gets a hefty prize for getting good grades. In this case, pricey and fun electronics. Because the thought is that if a bribe inspires my boy to turn around his grades, then I'm all for bribes.
We had been tossing back the idea of an xBox or xBox 360. But recently he wanted a Playstation Portable (PSP). Advice from PSP owners made me convince him otherwise. So now we are looking at the xBox thing or perhaps an iPod. If we get any of these, any and all advice would be handy. And if anyone wants to sell us one of these items for the kid to have, let me know.
Thursday, January 26, 2006
Problems with Fusebox
I liked Fusebox for about a year or so. After that, I started to catalog serious problems with the framework. As I explored the OO designs of Tartan, Model-Glue and Mach-ii, I began to be able to truly articulate my issues with this classic framework design. Of course, I am also of the thought that the problems I do have with the framework might and should be corrected in the nascent Fusebox 5, planned for release whenever the Fusebox team is done.
Enough meandering... what don't I like?
Distributed configuration files with matching names
All my Fusebox 4.x series applications have followed the MVC skeleton design. That is, all controller information is in the controller circuit, all view stuff is in the view circuit, and all model in the model circuit. Alas, all of these share the same name. Which means in every IDE in use, it can be hard to distinguish them by name alone.
Compounding that is the issue I have seen of other developers having nested circuits. All with the same name. Often called/run from the controller. Which adds complexity. Being a monkey, I don't like complexity, and now what should be a simple framework has become much more challenging.
Lack of Implicit Invocation
One thing I like about other frameworks is that you have a single event class that can be called that contains all the methods and values you need to handle business logic. This way I don't need to think much about the framework and instead can focus on the fun of business logic. Fusebox doesn't have this at all. Sure the attribute scope is handy, and you can do some fun and wonky tricks with the application.fb struct, but I can't as easily create dynamic logic to work with this sort of thing. And adding an object to any of these things is very problematic, as the attribute scope is for simple values only and the attribute.fb struct is... well... the core kernal of the application framework.
No Enforcement of Business Rules
All frameworks are guilty of this to some degree, but I think Fusebox is readily guilty of it. It is easy enough for people to stick CFINCLUDEs right into circuits, and it seems to happen all the time. I try to educate people otherwise and yet it still happens. It seems to me that people without a strong OO background fall for this trap more often than not in Fusebox, which makes me wonder if it has some weird connection with Fusebox's fundamentally OO nature.
Fusebox also has no means of enforcing naming conventions, but at least it has them. Still, someone ought to write a name checker or something.
I liked Fusebox for about a year or so. After that, I started to catalog serious problems with the framework. As I explored the OO designs of Tartan, Model-Glue and Mach-ii, I began to be able to truly articulate my issues with this classic framework design. Of course, I am also of the thought that the problems I do have with the framework might and should be corrected in the nascent Fusebox 5, planned for release whenever the Fusebox team is done.
Enough meandering... what don't I like?
Distributed configuration files with matching names
All my Fusebox 4.x series applications have followed the MVC skeleton design. That is, all controller information is in the controller circuit, all view stuff is in the view circuit, and all model in the model circuit. Alas, all of these share the same name. Which means in every IDE in use, it can be hard to distinguish them by name alone.
Compounding that is the issue I have seen of other developers having nested circuits. All with the same name. Often called/run from the controller. Which adds complexity. Being a monkey, I don't like complexity, and now what should be a simple framework has become much more challenging.
Lack of Implicit Invocation
One thing I like about other frameworks is that you have a single event class that can be called that contains all the methods and values you need to handle business logic. This way I don't need to think much about the framework and instead can focus on the fun of business logic. Fusebox doesn't have this at all. Sure the attribute scope is handy, and you can do some fun and wonky tricks with the application.fb struct, but I can't as easily create dynamic logic to work with this sort of thing. And adding an object to any of these things is very problematic, as the attribute scope is for simple values only and the attribute.fb struct is... well... the core kernal of the application framework.
No Enforcement of Business Rules
All frameworks are guilty of this to some degree, but I think Fusebox is readily guilty of it. It is easy enough for people to stick CFINCLUDEs right into circuits, and it seems to happen all the time. I try to educate people otherwise and yet it still happens. It seems to me that people without a strong OO background fall for this trap more often than not in Fusebox, which makes me wonder if it has some weird connection with Fusebox's fundamentally OO nature.
Fusebox also has no means of enforcing naming conventions, but at least it has them. Still, someone ought to write a name checker or something.
Monday, January 23, 2006
I am a Pythonista
On a professional level I was asked what system I would go with if I weren't doing CFMX and Java. And the only solution I would be interested in doing would involve Python. Python on Zope with Plone, or using Twisted and Nevow, or maybe even Turbogears. Heck, if I could I would get Jython into our CFMX and Java environment right now!
Why do I like Python so much?
Well, in a lot of ways I consider Python like ColdFusion on steriods. It has very similiar native types: Python possessing strings, integers, lists and dictionaries are much like ColdFusion's strings, numerics, arrays and structures. Many of the functions for both languages return values (ColdFusion breaks this frequently to my utter annoyance). Both can be used for rapid prototyping or real application development. Both can easily leverage a parent language that has some neat features to toss in (ColdFusion has Java vs CPython and C).
Python tends to look neater thanks to the indentation method of defining blocks, but well-formed ColdFusion is pretty too.
Python is stronger in the realm of OO, but both allow you to go procedural if you want.
But really, the reason why I like Python is that for a ColdFuson code monkey it was very easy to learn. And it shared ColdFusion's elegance and linked me to another world of development. It has opened doors and enlightened me in ways that have made me a better ColdFusion programmer. Python made me to find ways to push ColdFusion in new directions. And it taught me even more how to neaten my code.
Why do I like Python so much?
Well, in a lot of ways I consider Python like ColdFusion on steriods. It has very similiar native types: Python possessing strings, integers, lists and dictionaries are much like ColdFusion's strings, numerics, arrays and structures. Many of the functions for both languages return values (ColdFusion breaks this frequently to my utter annoyance). Both can be used for rapid prototyping or real application development. Both can easily leverage a parent language that has some neat features to toss in (ColdFusion has Java vs CPython and C).
Python tends to look neater thanks to the indentation method of defining blocks, but well-formed ColdFusion is pretty too.
Python is stronger in the realm of OO, but both allow you to go procedural if you want.
But really, the reason why I like Python is that for a ColdFuson code monkey it was very easy to learn. And it shared ColdFusion's elegance and linked me to another world of development. It has opened doors and enlightened me in ways that have made me a better ColdFusion programmer. Python made me to find ways to push ColdFusion in new directions. And it taught me even more how to neaten my code.
Friday, January 20, 2006
My preferred ColdFusion Development Tools
Over the years I have found a number of ColdFusion tools that I think really enhance my ability to deliver RAD applications that are easy to maintain and expand. All of these things can be used for free, which certainly does rock!
Textpad
This is a powerful, general text editor that has tons of extension libraries. I picked it up in mid 2003 and have never looked back. So I can use Textpad to help me do ColdFusion or Python or PL/SQL or whatever. It has pretty decent regex support (no POSIX though). It is easy to install and runs fast even on slow machines. It doesn't have FTP or RDF support, and that is its only really troublesome bit. It doesn't do code complete, but I don't really need that anyway.
cfEclipse
This is a very rich plug-in for the incredible IDE Eclipse. It does so much, is free, and seems to run much faster than Dreamweaver or Homesite Studio. The SVN plug-in rocks if you get Subversion for source control. If I have the time and energy to install something that does code-complete, this is what I'll use.
cfQuickDocs
I don't like to use most function reference books besides small ones for regex and sql tricks. Having an API listed online in a format that is really fast and easy to use is my preferred way of getting necessary documentation. This awesome AJAX application scrapes content off of the CFMX 7 livedocs and serves it to you nicely.
Spike's cfcDoc
Need good documentation of your CFCs? How about in something that resembles JavaDoc? Spike's work here is awesome. Other people have extended it, but I like the original still.
Trac Wiki & Task Tracker & SVN inteface
Trac is awesome because it does so much for you and is yet so easy to use. I love Wikis for use in development. I need task tracking because I do. And I prefer a good, solid source control system. Trac helps you enable all three.
Lighthouse Pro
Ray Camden's nifty Task Tracking system, its earlier version is really light (xml holds data files) but easier to deploy. This Pro version stores it in a database and is easier to use and configure. If you can't have Trac, then get this and you can't go wrong.
Over the years I have found a number of ColdFusion tools that I think really enhance my ability to deliver RAD applications that are easy to maintain and expand. All of these things can be used for free, which certainly does rock!
Textpad
This is a powerful, general text editor that has tons of extension libraries. I picked it up in mid 2003 and have never looked back. So I can use Textpad to help me do ColdFusion or Python or PL/SQL or whatever. It has pretty decent regex support (no POSIX though). It is easy to install and runs fast even on slow machines. It doesn't have FTP or RDF support, and that is its only really troublesome bit. It doesn't do code complete, but I don't really need that anyway.
cfEclipse
This is a very rich plug-in for the incredible IDE Eclipse. It does so much, is free, and seems to run much faster than Dreamweaver or Homesite Studio. The SVN plug-in rocks if you get Subversion for source control. If I have the time and energy to install something that does code-complete, this is what I'll use.
cfQuickDocs
I don't like to use most function reference books besides small ones for regex and sql tricks. Having an API listed online in a format that is really fast and easy to use is my preferred way of getting necessary documentation. This awesome AJAX application scrapes content off of the CFMX 7 livedocs and serves it to you nicely.
Spike's cfcDoc
Need good documentation of your CFCs? How about in something that resembles JavaDoc? Spike's work here is awesome. Other people have extended it, but I like the original still.
Trac Wiki & Task Tracker & SVN inteface
Trac is awesome because it does so much for you and is yet so easy to use. I love Wikis for use in development. I need task tracking because I do. And I prefer a good, solid source control system. Trac helps you enable all three.
Lighthouse Pro
Ray Camden's nifty Task Tracking system, its earlier version is really light (xml holds data files) but easier to deploy. This Pro version stores it in a database and is easier to use and configure. If you can't have Trac, then get this and you can't go wrong.
Job Hunt on Hold
Some developments at work have meant that I am putting the job hunt on hold. Depending on how SAIC's contract with NASA goes, this means that I either will be here for another 4-5 months or another 5 odd years. Of course, I would prefer to stay, so this makes me happy.
Some developments at work have meant that I am putting the job hunt on hold. Depending on how SAIC's contract with NASA goes, this means that I either will be here for another 4-5 months or another 5 odd years. Of course, I would prefer to stay, so this makes me happy.
Thursday, January 19, 2006
Lambda Fun
Coming from my liberal arts background, I never learned Lisp or Scheme in college. So the anonymous Lambda function in Python always escaped me. As a baby Pythonista, this was rather humiliating. So when I finally grokked it after way too much effort, it was like my brain exploded. In essence, the problem was that I thought about it too hard, when in reality, the lambda capability of Python, Lisp, Scheme, et al is actually a simple concept.
So now, of course, I've been trying to figure out how to make it work in ColdFusion. The problem, alas, is that to make it work I would have to return a function from the lambda function. And that just isn't possible. So what about returning a new object? Of course, that would destroy the beautful elegance I get in python via:
f = lamba x, y, z: x + y+ z
f(2, 3, 4)
Result : 9
Instead, in ColdFusion I could code something like:
f = lamba("x, y, z : x + y+ z");
f.lambda(2, 3, 4);
Result: 9
Basically, the ColdFusion method would be turning the nice, elegant Python function into a object factory. Now I have no problem with object factories, but is this really the way to go?
I don't know. I am wondering if doing a Lambda function is sheer overkill in CFMX.
Coming from my liberal arts background, I never learned Lisp or Scheme in college. So the anonymous Lambda function in Python always escaped me. As a baby Pythonista, this was rather humiliating. So when I finally grokked it after way too much effort, it was like my brain exploded. In essence, the problem was that I thought about it too hard, when in reality, the lambda capability of Python, Lisp, Scheme, et al is actually a simple concept.
So now, of course, I've been trying to figure out how to make it work in ColdFusion. The problem, alas, is that to make it work I would have to return a function from the lambda function. And that just isn't possible. So what about returning a new object? Of course, that would destroy the beautful elegance I get in python via:
f = lamba x, y, z: x + y+ z
f(2, 3, 4)
Result : 9
Instead, in ColdFusion I could code something like:
f = lamba("x, y, z : x + y+ z");
f.lambda(2, 3, 4);
Result: 9
Basically, the ColdFusion method would be turning the nice, elegant Python function into a object factory. Now I have no problem with object factories, but is this really the way to go?
I don't know. I am wondering if doing a Lambda function is sheer overkill in CFMX.