Thursday, October 6, 2016

More Date Masking

I'm a bit ashamed of myself. I've been a member of the ColdFusion Community for over 15 years, yet I just submitted my first bug to the BugBase yesterday. And I'm not even really sure that it's a "bug" per se; just an inconsistency in behavior of similar functions.

https://bugbase.adobe.com/index.cfm?event=bug&id=4194962
(Lucee bug added: https://luceeserver.atlassian.net/browse/LDEV-1025)

Basically, it touches on what has become a pet-peeve of mine: Date Masking. I know I've ranted about it before, but I wish that everyone could just agree on what a proper date mask was for all of the common date parts.

In the latest update to ColdFusion, Update 3, one of the things Adobe announced in the release notes was that you can now use lower- or upper-case letters in DateFormat() masking. My issue with this is that it is completely different behavior from DateTimeFormat(), which seems to make a bit more use of Java's case-sensitive SimpleDateFormat. Granted, I don't agree with Java's way of using "M" to mean "months" and "m" to mean "minutes" (I like CF's "n" minutes), but I still think the two CF functions should be consistent with each other. It's feasible that a dev would have to switch between a date format with and without a time component or have multiple types of date masks on the same page. And the natural assumption would be that the mask from one should work as the mask for the other. At least I would think so.

Last year, I got bit by this behavior when it came to the Year mask. December 29, 2015 was being displayed as 12/29/2016. ???? FYI: DateFormat(someDate,"MM/DD/YYYY") may not return the same thing as DateTimeFormat(someDate,"MM/DD/YYYY"). This is where I learned about the slight difference between a Calendar Year and a Week Year. Not to mention the fact that it will only happen at most on the last few days of a year.

And to make matters worse, we also used moment.js, which expects the year to be formatted as a capital "Y". :-/

I've never made it a secret that I'm not a fan of silent errors. And, yes, this would be an error on the developer's part for not using the proper mask, but it's an easy error to make (especially when using different masks) and even easier to completely miss.

I would like to see Adobe make the date formatting functions be a bit more consistent with each other.


THANK YOU, TRYCF.COM! http://trycf.com/gist/78a374effc62c05330cd33030da265cd/acf2016?theme=monokai

Adobe ColdFusion 2016
Adobe ColdFusion 10

And Lucee just gets wonky with its CFMXish behavior of kinda passing through masks it can't interpret.
Lucee 4.5

Monday, October 3, 2016

ColdFusion 2016 Update 3 Is Live!

http://blogs.coldfusion.com/post.cfm/updates-for-coldfusion-2016-and-coldfusion-builder-2016-is-available-now

ColdFusion 2016 Update 3 is now live. There were quite a few bugs fixed. https://helpx.adobe.com/coldfusion/kb/bugs-fixed-coldfusion-2016-update-3.html

Boolean Girl - STEM Teaching With RaspberryPi

I should have shared this last week when I saw it. STEM education, especially when it comes to bringing more young girls into the dev community, is one of my soap boxes. And as a geek (and lover of Erector sets and those old "Build Your Own Radio" kits with springs and wires from the 80s), the RaspberryPi is one of the coolest inventions of my lifetime. So when I saw the Kickstarter for the Boolean Box, I ordered one for my niece (and to be honest, one for myself, too). Please, if this interests you, back it. 

Boolean Box Kickstarter  (https://www.kickstarter.com/projects/71092263/boolean-box-a-technology-discovery-kit-for-girls)

Boolean Girl Website (http://www.booleangirl.org/)

DON'T PANIC!

Before I was a code monkey, I flew airplanes. I never realized how the lessons I learned then could apply to regular life. I've always said I can teach someone to fly a plane in just a few hours; it's the hours after those first few that teach you to be ready for the unexpected. You learn early that when things go sideways, you only make it worse if you panic.

I was driving back to North Carolina from Nashville on Sunday, and I had a tire-disintegrating blowout. I drive a Silverado, so it wasn't a small tire. I was in traffic, doing about 75 mph, when my front passenger tire decided it was time to let go. I'm sure anyone who's ever had a blowout can attest that it's somewhat of an adverse situation. And I know we've all seen news reports of serious road accidents caused by a high-speed blowout.

So how does this relate to piloting? First and foremost, as I said above, when bad things happen, you learn to stay calm and deal with the problem. More directly, when flying multi-engine aircraft, one of the first things you learn is how to deal with an engine failure and the resulting tendency to "pull" to one side. When bad things happen, like an engine failure or a blowout, they don't usually give you a lot of warning. So you learn that, rather than be surprised, you STAY CALM and KEEP OPERATING YOUR VEHICLE.

When my tire blew, my truck immediately started pulling me to the right. But there was a car there who probably wasn't too keen on sharing space with me. So I couldn't let my truck take me there. I let off the gas and, when I was clear, moved over to the shoulder. I didn't panic.

As I write this, I'm sitting in NTB having a new tire mounted. This isn't how I wanted to spend my lunch break today, but it could have been much worse. I could have been one of those stories on the nightly news. But instead, when a bad situation suddenly developed, I kept my head and dealt with the problem. My old training (even though it was in airplanes and not cars) kicked in.

A quick Google search shows that my lessons weren't exactly unique to piloting. They were based in some common sense steps for disaster preparedness found in many fields. Operate, Communicate, Mitigate. In that order. Whether you're flying a plane, driving a car, or dreaming peacefully in bed, you should be prepared for the engine failure, the blowout, or the 3am call that lets you know the website is down. If you know what you're going to do when a problem happens, you won't have to think about how to handle it when it finally does.


NOTE TO OTHER DRIVERS: If you see someone on the side of the road, PLEASE PLEASE PLEASE show a little bit of courtesy and move over. It's rather unsettling to have a car zip past you at 70+ mph. Especially when they're only a few feet from you.