ColdFusion Leap Year bug still there
So just got ColdFusion 9 Beta 2 up and running and my old leap year bug is still there. I’ve posted a public bug, #78713 now the tracker has been launched. It effects 7, 8 & 9 so hopefully it’ll get fixed!
So just got ColdFusion 9 Beta 2 up and running and my old leap year bug is still there. I’ve posted a public bug, #78713 now the tracker has been launched. It effects 7, 8 & 9 so hopefully it’ll get fixed!
A few new releases for you to catch up on. Firstly Wordpress 2.8.1 – essentially a bug fix and security release by the look of it but worth doing anyway, quick note that if you get stuck with a maintenance page check in your web root for a file called .maintenance, just rename that and the site will come back.
Next up two public beta’s from Adobe. ColdFusion 9 boasting some new useful and some not so useful/utterly pointless changes and the ColdFusion Builder which can either be standalone or as a plugin to Eclipse.
The latest update to ColdFusion has been released in the form of 8.0.1 which will let you have a painless install on Leopard and on 64 bit OS’
Full details on the Adobe site.
A lot of other tweaks and bug fixes as well including new FCKEditor and changes to the attributeCollection stuff.
So just an update on this. I sent off some emails to folks at Adobe and have had acknowledgment but as yet no reply. I’ll you know if and when I get something back.
My colleague noticed that as of midnight GMT one of our applications at work broke. After some digging it looks like a CF leap year bug.
<cfset attributes.minage = 18>
<cfoutput>
#now()#<br />
#attributes.minage#<br />
#dateadd("yyyy", -(attributes.minage), now())#<br>
#datediff("yyyy", dateadd("yyyy", -(attributes.minage), now()), now())#<br />
#datediff("yyyy", dateadd("yyyy", -(attributes.minage), now()), DateAdd("d", 1, now()))#
</cfoutput>
The code was run on CF 7.0.1, 7.0.2 & 8.0.0 on Windows and Linux, all produce same results.
Not sure for definite it's a bug, but, it's always worked until today, in theory it might work again tomorrow as well. Last leap year of course was CF6 so may not have shown up.
Yay for dateDiff()...
Update
A more detailed example. It only effects the 28/2. Other dates fine suggesting more that it's leap year related.
<cfoutput>
<cfset variables.datea = createDate(2008,02,3)>
<cfloop from="2008" to="1990" step="-1" index="variables.y">
<cfset variables.dateb = createDate(variables.y,02,3)>
<cfset variables.diff = datediff("yyyy", variables.datea, variables.dateb)>
#variables.datea# - #variables.dateb# = #variables.diff#<br />
</cfloop>
</cfoutput>
And it’s output….
{ts '2008-02-28 00:00:00'} - {ts '2008-02-28 00:00:00'} = 0
{ts '2008-02-28 00:00:00'} - {ts '2007-02-28 00:00:00'} = 0
{ts '2008-02-28 00:00:00'} - {ts '2006-02-28 00:00:00'} = -1
{ts '2008-02-28 00:00:00'} - {ts '2005-02-28 00:00:00'} = -2
{ts '2008-02-28 00:00:00'} - {ts '2004-02-28 00:00:00'} = -4
{ts '2008-02-28 00:00:00'} - {ts '2003-02-28 00:00:00'} = -4
{ts '2008-02-28 00:00:00'} - {ts '2002-02-28 00:00:00'} = -5
{ts '2008-02-28 00:00:00'} - {ts '2001-02-28 00:00:00'} = -6
{ts '2008-02-28 00:00:00'} - {ts '2000-02-28 00:00:00'} = -8
{ts '2008-02-28 00:00:00'} - {ts '1999-02-28 00:00:00'} = -8
{ts '2008-02-28 00:00:00'} - {ts '1998-02-28 00:00:00'} = -9
{ts '2008-02-28 00:00:00'} - {ts '1997-02-28 00:00:00'} = -10
{ts '2008-02-28 00:00:00'} - {ts '1996-02-28 00:00:00'} = -12
{ts '2008-02-28 00:00:00'} - {ts '1995-02-28 00:00:00'} = -12
{ts '2008-02-28 00:00:00'} - {ts '1994-02-28 00:00:00'} = -13
{ts '2008-02-28 00:00:00'} - {ts '1993-02-28 00:00:00'} = -14
{ts '2008-02-28 00:00:00'} - {ts '1992-02-28 00:00:00'} = -16
{ts '2008-02-28 00:00:00'} - {ts '1991-02-28 00:00:00'} = -16
{ts '2008-02-28 00:00:00'} - {ts '1990-02-28 00:00:00'} = -17
So late the blog as ever, but off the back of MAX ColdFusion 9 has been announced with the codename “Centaur”. Adobe run about 2 year product cycles so I suspect it’ll be 2009.
Launch date 09/09/09?
Adobe’s new product icon’s have been making quite a few waves in the blogsphere and to be honest I can see why.
Initial reaction has to be that it’s based on the Periodic table, perhaps the designer is a science buff? Letters in boxes may be web2.0, but, it’s product identification and branding, I can’t help think that a little more thought should have gone into it. Then again, I’m no graphics designer, but, I’m not sure I’d have signed it off!
If you’re running Apache 1.3.x and Coldfusion 7 you might have had errors when starting apache about needing to compile it using DEAPI.
[warn] Loaded DSO /opt/coldfusionmx/runtime/lib/wsconfig/1/mod_jrun.so uses
plain Apache 1.3 API, this module might crash under EAPI!
(please recompile it with -DEAPI).
The original Adobe technote 18748 worked with CF6 as I’ve followed it before, but, with CF7 once compile and you try and start apache you get a crazy hex error, like this:
Cannot load /opt/coldfusionmx7/runtime/servers/lib/wsconfig/1/mod_jrun.so into
server: /opt/coldfusionmx7/runtime/servers/lib/wsconfig/1/mod_jrun.so: undefined symbol: hexstrtol
A quick google found this site with a script on how to do it. Now one note on the guide is he’s building a mod_jrun20.so file for apache 2, quick vi to change them all to mod_jrun.so and you’re all good.
So, big thanks to that guy for posting his script. Mine is included below for reference.
#!/bin/bash
export CFMX=/opt/coldfusionmx7
export APACHE_PATH=/usr/local/apache
export APACHE_BIN=$APACHE_PATH/bin
#CFMX connector path eg $CFMX/runtime/lib/wsconfig/1
export CFMX_CONNECTOR=$CFMX/lib/wsconfig/1
#stop apache
$APACHE_BIN/apachectl stop
${APACHE_BIN}/apxs -c -Wc,-w -n jrun -S LIBEXECDIR=${CFMX_CONNECTOR} mod_jrun.c
jrun_maptable_impl.c jrun_property.c jrun_session.c platform.c
jrun_utils.c jrun_mutex.c jrun_proxy.c jrun_ssl.c
${APACHE_BIN}/apxs -i -n jrun -S LIBEXECDIR=${CFMX_CONNECTOR} mod_jrun.la
strip $CFMX_CONNECTOR/mod_jrun.so
Mine did error saying:
apxs:Error: file mod_jrun.la is not a DSO
but it all works.
Found a new bug today in Coldfusion 7. Basically if you create structure via arguments and try to use it later you’ll notice some funky behaviour and the meta information about the structure is incorrect. Code test case is included.
<cfset s = struct(arg1=“blahblah”, arg2=“cont”, arg3=“act”)>
<cfoutput>
<h3>#s.getClass()#</h3>
length: #structcount(s)# (#structkeylist(s)#)<br>
<cfset structdelete(s, ‘arg1′)>
length: #structcount(s)# (#structkeylist(s)#)<br>
<cfset structdelete(s, ‘arg2′)>
length: #structcount(s)# (#structkeylist(s)#) </cfoutput>
<cfset s = structnew()>
<cfset s['arg1'] = “blahblah”>
<cfset s['arg2'] = “cont”>
<cfset s['arg3'] = “act”>
<cfoutput>
<h3>#s.getClass()#</h3>
length: #structcount(s)# (#structkeylist(s)#)<br>
<cfset structdelete(s, ‘arg1′)>
length: #structcount(s)# (#structkeylist(s)#)<br>
<cfset structdelete(s, ‘arg2′)>
length: #structcount(s)# (#structkeylist(s)#) </cfoutput>
Just a quick warning, got the latest Coldfusion trial download off the MM site for Linux (coldfusion-701-lin.bin) and it doesn’t work. It installs fine, but, won’t start.
Downloaded the old version coldfusion-70-lin.bin, installed it, patched it and it starts up fine. Not sure if this is all OS’s but certainly the Linux one is dodgy.