Skip to main content
Ben Nadel at cf.Objective() 2014 (Bloomington, MN) with: Alec Irwin
Ben Nadel at cf.Objective() 2014 (Bloomington, MN) with: Alec Irwin

Recent Activity

Recent Heroes of the BenNadel.com Community

  • Murray Hopkins 3 comments 🔥
    Posted 41 comments since December 11, 2008
  • BKBK 3 comments 🔥
    Posted 3 comments since August 3, 2022
  • Sasha 3 comments 🔥
    Posted 3 comments since August 10, 2022
  • Charles Robertson 2 comments 😍
    Posted 414 comments since October 5, 2014
  • nana 2 comments 😍
    Posted 2 comments since July 25, 2022
  • Bilal 1 comment 😍
    Posted 7 comments since March 16, 2010
  • Frederic Fortier 1 comment 😍
    Posted 15 comments since March 29, 2011
  • Rick Mason 1 comment 😍
    Posted 3 comments since April 26, 2018
  • Hassam Ali ( hassamali.com ) 1 comment 😍
    Posted 11 comments since September 2, 2019
  • Danilo Celic 1 comment 😍
    Posted 16 comments since August 12, 2021
  • Roberto 1 comment 😍
    Posted 1 comment since July 25, 2022
  • Adam Chapman 1 comment 😍
    Posted 1 comment since July 27, 2022
  • Marcel Jöstingmeier 1 comment 😍
    Posted 1 comment since August 3, 2022
  • Dave Merrill 1 comment 😍
    Posted 1 comment since August 10, 2022
  • Mario Luevanos ( marioluevanos.com ) 1 comment 😍
    Posted 1 comment since August 18, 2022

Recent Comments

Ben Nadel replied to a post Detecting Rendered Line Breaks In A Text Node In JavaScript

Here's a fast-follow to demonstrate how I am intending to use this line-extraction technique in order to help write text to the <canvas> object: https://www.bennadel.com/blog/4311-rendering-wrapped-text-to-a-canvas-in-javascript.htm Essentially, with Canvas, there is no "wrapped text" concept. As su... read more

Ben Nadel replied to a post Detecting Rendered Line Breaks In A Text Node In JavaScript

@Mario, I think I played around with the TreeWalker API a number of years ago because I was trying to access Comment nodes in the DOM and jQuery, at least at the time, didn't make it super easy to get at non-Element nodes. To be honest, I don't have my head wrapped around the full use-cases for Rang... read more

Ben Nadel replied to a post Detecting Rendered Line Breaks In A Text Node In JavaScript

@Hassam, Thanks! It would be great if there was something "more native" that would expose this information, though, so it could have better performance. I just assume that calculating the Range values over and over again for each character is relatively slow. But, for my purposes, it seems to be fas... read more

Ben Nadel replied to a post Updated Thoughts On Validating Data In My Service Layer In ColdFusion

@Bilal, I used Joi for a bit a few years ago when I was on a team that was building Node.js services. It was an interesting approach. I don't love configuration-based approaches to validation; but, I think that mostly stems from me not having much hands-on experience. Sometimes, I just prefer to bru... read more

Bilal replied to a post Updated Thoughts On Validating Data In My Service Layer In ColdFusion

Ben, I like the general thoughts you put into this. In the JS world the validation library for complex object inline validation that I use is JOI. It allows a chaining of validation conditions and validation of complex structures at each node with many options. Maybe something to review for ideas on... read more

Ben Nadel replied to a post Strangler: Building A Feature Flag System In ColdFusion

As part of this POC, I had to think about data validation and normalization in a new way. I've tried to extract those concepts out into their own post: https://www.bennadel.com/blog/4308-updated-thoughts-on-validating-data-in-my-service-layer-in-coldfusion.htm I've already started using this "Valida... read more

Ben Nadel replied to a post Validating Complex, Nested, Dynamic Data Structures In ColdFusion

@All, Regarding my previous comment, on making my Validation component responsible for validation and normalization and transformation, I have a post that goes into that concept more in-depth: https://www.bennadel.com/blog/4308-updated-thoughts-on-validating-data-in-my-service-layer-in-coldfusion.ht... read more

Ben Nadel replied to a post Updated Thoughts On Validating Data In My Service Layer In ColdFusion

If you want to see a more real-world example of this "Validation component", check out the FeatureFlagValidation.cfc in my Stangler repository. It handles all the validation, transformation, and normalization for the aforementioned feature flag data before it gets persisted to a JSON file.... read more

Ben Nadel replied to a post Validating Complex, Nested, Dynamic Data Structures In ColdFusion

So, after fleshing-out the underlying demo, I ended up changing my approach slightly. I still have a "Validation" component; and, this component still makes sure nothing untoward gets through; but, the validation object now returns sanitized data. So, instead of just calling something like: validati... read more

Ben Nadel replied to a post Working Code Podcast - Episode 87: Note To Self

@Danilo, Uggg, I totally forgot that was an issue 😰 I'll fix that this week! Thanks for the reminder. I got so used to a different way of clearing the cache, I forgot it didn't touch all the necessary cache entries.... read more

Ben Nadel replied to a post Adding Strict-Transport-Security (HSTS) HTTP Header In ColdFusion 2021

@Dave, My only concern was that I might not have an SSL certificate in my local environment. If I were running in something like a Docker'ized container, with nginx in front of ColdFusion, then it probably would have some sort of self-signed certificate. But, if I were running the local dev environm... read more

BKBK replied to a post RequestTimeout Setting Affects CFThread Execution In Lucee CFML 5.3.6.61

@Ben My initial attempt to use the CFSetting tag was trying to use the createTimeSpan() function for the requestTimeout. It's been a long time since I've even used this tag. But, it doesn't work that way :D You have to provide a number of seconds, not a time span Indeed. The value of RequestTimeout ... read more

BKBK replied to a post RequestTimeout Setting Affects CFThread Execution In Lucee CFML 5.3.6.61

@Ben, I have been looking some more into your discovery that, from Lucee 5.3.6.61 onwards, the following code will effectively stop the thread after the timeout period of 15 seconds: thread name="testThread" { setting reqtestTimeout=15; // Do some thread stuff/ } I still haven't found any d... read more

BKBK replied to a post RequestTimeout Setting Affects CFThread Execution In Lucee CFML 5.3.6.61

Great article on a crucial subject. The ability to time out a thread has huge implications. For one thing, it can mean the difference between a rogue thread being stopped in its tracks or being free to hang about and hog memory for as long as it wants. However, there are questions I should like to b... read more

Ben Nadel replied to a post Pretty-Printing JSON Using GSON In Lucee CFML 5.3.9.141

@Murray, That actually sounds a lot like how the JSON.stringify() method works in JavaScript. It's signature is like this: JSON.stringify( value [, replacer [, space ]] ) ... where the second param is your callback, and the third param is for the pretty-printing functionality that I'm doing in GSON.... read more

Murray Hopkins replied to a post Pretty-Printing JSON Using GSON In Lucee CFML 5.3.9.141

@Ben, Yes, the GSON builder with its customisable policies and strategies is a good pattern that makes the serialization very ... customisable. However, I also found it didn't play well with Lucee Structs without having to do even more work. I thought the idea was a good one and made a Lucee languag... read more

nana replied to a post Having Fun With The SpeechSynthesis API In Angular 11.0.5

@Ben, Thank you very much for your answer. Finally I ran this code (which you posted) and it worked without issue. I figured out it was just a TypeScript item. Before, I thought I had to install plugins to make it work. And I'm not running it on electron, just on browser. and i don't either use elec... read more

Ben Nadel replied to a post Pretty-Printing JSON Using GSON In Lucee CFML 5.3.9.141

@Murray, Yeah, I tried looking at the GSON "builder" to see if I could define some sort of setting for numbers. They have some number strategy options, but it looks like they were for the deserialization aspects, not the serialization aspects. You can define some sort of custom Java classes; but, th... read more

Murray Hopkins replied to a post Pretty-Printing JSON Using GSON In Lucee CFML 5.3.9.141

Thanks Ben. I recently looked at GSON in my exploration of Serialisation options for a Lucee project (mainly trying to get lowercase keys). Forum post One thing I noticed (probably not relevant for your use-case here) is that GSON is not accurate in its JSON representation. For example, your count a... read more

Ben Nadel replied to a post Understanding Struct Key-Casing Using SerializeJson() In Lucee 5.3.2.77

@Frederic, Oh heck yeah! I've been a big fan of ordered-structs since I realized that Lucee (and ACF) have this syntax. For the most part, in a production app it doesn't really matter what order keys are in. But, when doing demos with screen shots or outputting JSON, seeing the keys in a "human frie... read more

Ben Nadel replied to a post Having Fun With The SpeechSynthesis API In Angular 11.0.5

@Nana, Unfortunately, I don't have any experience with Ionic. But, my understanding is that the Ionic package is just a UI framework for the web; so, I don't think it would impose any additional constraints. As such, I think you can just use the Browser's native speech synthesis API (as I have done ... read more

Ben Nadel replied to a post Validating Complex, Nested, Dynamic Data Structures In ColdFusion

@Roberto, Do you have a sense of where in the application should be responsible for this kind of JSON validation? I've been struggling to wrap my head around a solution that feels right. I think for the JSON validation itself - ie, the data that is to be persisted - then that should be in the data p... read more

Ben Nadel replied to a post Validating Complex, Nested, Dynamic Data Structures In ColdFusion

@Adam, You are 100% correct. The tests within a rule are and'ed but the rules are or'ed. Basically, I am just looping over the rules and finding the first one that matches all the tests and then returning it's variant (based on the rollout, which is either a single value or a weighed distribution). ... read more