Skip to main content

Recent Activity

Recent Heroes of the BenNadel.com Community

Recent Comments

Ben Nadel replied to a post Using Seekable Read Files In ColdFusion

In the post above, I'm looking at using the fileRead() method in conjunction with seekable files. In a follow-up post, I look at using fileReadLine(): https://www.bennadel.com/blog/4515-using-filereadline-with-seekable-files-in-coldfusion.htm I'm noodling on ways to create a resumable large-text-fil... read entire comment from Ben Nadel.

Dustin D replied to a post The User Experience (UX) Of Disabled Form Buttons

Having just found this, I love the perspective you provide here. I hadn't heard of the robustness principle before, at least in the same vernacular. I have typically lumped that in with error tolerance. There are also a couple other UX problems that disabled buttons create that I thought should be i... read entire comment from Dustin D.

Emre replied to a post Using Labeled Loops In ColdFusion

I think my previous post didn't account for the last break in the outer while loop. Instead of using a break when it reaches the end, it needs a condition in the outer while, but below is the same code without the labeled out-of-sequence-breaking loops. function isFuzzyMatch(targetValue, searchValue... read entire comment from Emre.

Ben Nadel replied to a post Using Labeled Loops In ColdFusion

@Emre, This is a great point-out. And, in fact, in my original code, I have the early return(true) to short-circuit the evaluation. I put the matchFound variable in there in order to explore the labeled-looping a bit more. That said, your second break will break the algorithm. Essentially, you stop ... read entire comment from Ben Nadel.

Emre replied to a post Using Labeled Loops In ColdFusion

Great, but in the example you don't need any of this. On line 37 instead of setting matchFound = true, just return true. No reason to keep going any further. You don't even need the matchFound variable. Replace line 53 with a normal break, since breaking from inner loop will do same as continuing th... read entire comment from Emre.

Ben Nadel replied to a post Using Labeled Loops In ColdFusion

@Angeli, To be fair, I think labeled-loops was only added in recent versions of ColdFusion -- the one article that I found on this references ACF 2021 as being the version in question. But, I can't find a "history" section on the docs page, like they used to have. Re: scraping, I remember waaaaay ba... read entire comment from Ben Nadel.

Angeli Wahlstedt replied to a post Using Labeled Loops In ColdFusion

Very interesting. I've been coding in CF since late 1990's, and I had no idea the labels existed. One real-world example using them would be scraping documents for specific types of data. (Scraping is one of my specialties, and trust me, there's a lot of conditional logic going on in scraping.) But ... read entire comment from Angeli Wahlstedt.

Ben Nadel replied to a post Using Seekable Read Files In ColdFusion

@Chris, The .seek() just jumps to a specific location. It's the subsequent call to .read() that is pulling-out 3-bytes: dataSource.read( 3 ) And, it might be worth mentioning for completeness that calling .read() will also advance the internal pointer. Meaning, if you call .read(3) two times in a ro... read entire comment from Ben Nadel.

I believe in love. I believe in compassion. I believe in human rights. I believe that we can afford to give more of these gifts to the world around us because it costs us nothing to be decent and kind and understanding. And, I want you to know that when you land on this site, you are accepted for who you are, no matter how you identify, what truths you live, or whatever kind of goofy shit makes you feel alive! Rock on with your bad self!
Ben Nadel