More conferencesNeed more conferences, this site has a huge list of conferences for almost any language/community.
https://confs.tech/Blogs, Posts, and Videos of the Week6/14/24 - Blog - Robert Zehnder - Parsing and Formatting ISO 8601 Time Intervals with CFYesterday when I was working on the recipe API i needed a way to parse ISO 8601 time intervals and to display it in a human friendly format. I had started down the road of using java to handle this for me by initially using java.time.Duration to parse out the data in to days, minutes, hours, etc and that worked really well.
I thought I would be clever and write a function to format the output for me by "mathing out" the hours, minutes, and seconds and out put that as a string. It got complex and unwieldy quickly. Since I was already using java to parse the duration I thought I would see if there is a way to format it as well. In CF org.apache.commons includes DurationFormatUtils that will allow us to output durations in several different formats. I decided to use formatDurationWords.
https://kisdigital.com/posts/2024/06/parsing-iso-8601-time-intervals-with-cfSee also: Coda —
https://forgebox.io/view/coda8/5/24 - Blog - Ortus Solutions - Unlock the Power of REST APIs with ColdBox!ColdBox provides a comprehensive framework for building robust REST APIs for more than 10 years now. It includes everything you need, from routing and headers to basic authentication and data handling. With ColdBox, you can quickly set up your API and deliver high-quality web services.
https://www.ortussolutions.com/blog/unlock-the-power-of-rest-apis-with-coldboxBoxLang Corner6/13/24 - X Post - Kai Koenig (quoted by Ortus Solutions)
@AgentK on "@BoxLang vs the world" at @CFCamp: "BoxLang had better tooling before its first release than any other CF platform currently has."
https://x.com/ortussolutions/status/18012371600680839147/9/24 - Community Post - Brad Wood - Java Method References and higher order functionsWe’ve added some more goodies to our BoxLang Java interop, this time around method references and high order functions. These are things CF has never let you do, leaving Java interop a second-class citizen in the language.
CF already allows you to grab a reference to a UDF or closure as a variable, pass it around, and invoke it.
```
myInstance = new myClass();
myInstanceMethod = myInstance.myMethod;
myInstanceMethod();
```
BL also allows you to grab a reference to a static method from a Box class as well:
```
myStaticUDF = src.test.java.TestCases.phase3.StaticTest::sayHello;
myStaticUDF();
```
Now, in BoxLang, we’ve elevated Java methods, both instance and static to also be objects you can pass around, invoke, and send into a higher order function (a function that accepts functions).
When you reference a method on a Java class without the parenthesis (just like our BL examples above), you will get a special Function instance that wraps up the Java method, allowing it to be treated as a function, passed into any argument which is typed as a function, and invoked headlessly.
https://community.ortussolutions.com/t/java-method-references-and-higher-order-functions/102397/18/24 - Community Post - Brad Wood - Example Code: Using Java Streams in BoxLangHere’s a couple quick code samples of how awesome Java Streams are to use now in BoxLang. In the past, CF lacked the proper Java interop to directly use streams, which is why we created CF libraries like cbstreams. Java Streams ARE crazy super powerful and you should probably check them out. They make CF’s simple data structures and limited functional abilities look pretty lame to be honest. Streams have been around since Java 8, and it’s sad to see how CF has fallen behind in comparison.
You can do a million things with streams, including super easy parallel operations, but this isn’t a primer on everything streams do. Two of the features streams provide (partitioning and grouping) came up in another thread so I cooked up a couple examples to show how easy BoxLang has made it to dip down into java, even being able to provide first-class BL functions as Java functional interfaces.
https://community.ortussolutions.com/t/example-code-using-java-streams-in-boxlang/10264/17/18/24 - Community Post - Brad Wood - New Feature: Functional binding to member methodsThis is a follow-on from yesterday’s post 1 that showed how BoxLang now allows you to perform functional static binding to BIFs (built in functions) like so:
```
[ "luis", "brad", "jon" ].map( ::uCase ) // [ "BRAD","LUIS","JON" ]
```
Another type of method reference you may want to bind to is a member method on an object. Member methods could be
```
order.submit() // method on a class
companyName.uCase() // BoxLang string member method
companyName.getBytes() // Java String member method
```
So, historically we can declare a closure to call these methods for us like so:
```
pendingOrders.each( order => order.submit() )
```
This new feature allows us to create a first-class function that points to that method reference, but is not bound to a specific instance.
https://community.ortussolutions.com/t/new-feature-functional-binding-to-member-methods/102637/23/24 - Blog - Daniel Mejia - Effortless Deployment: Launching Your BoxLang Miniserver!Deploying a BoxLang mini-server website to Render.com can be straightforward and efficient when using a Docker image built with GitHub Actions. The deployment process allows you to commit changes to your website code on GitHub. The GitHub action will automatically build the container image and push it to the GitHub Container Registry. Finally, an HTTP GET request to the Render.com redeploy webhook deploys the container image with the latest code changes. The entire process, from committing on your machine to a live deployment on Render.com, takes about 90 seconds!
https://www.ortussolutions.com/blog/launching-your-boxlang-miniserver7/25/24 - Community Post - Brad Wood - New member methods for Java StreamsIn BoxLang we already have member methods you’re used to on the common data types such as structs, arrays, strings, numbers, etc. Since we intercept method calls, we have the ability to define method methods on ANY variable type. We’ve added some nice little helpers to Java Streams to wrap up some of the cool stream Collectors we’ve built. A collector is a terminal operation on a stream which “collects” the values in the stream into a single object, kind of like a pre-built reduce operation but more powerful.
https://community.ortussolutions.com/t/new-member-methods-for-java-streams/10275/1
8/3/24 - Community Post - Brad Wood - BoxLang BIF -> Member MethodsOk, so I’m ready to pull the trigger on one of our many departures from CF in BoxLang and I want to solicit a bit of feedback before proceeding. One of our driving goals of the 2-parser design and transpiler was being able to “fix” the warts of CF that we wish had been done differently. (I’m not throwing CF under the bus here-- BIFs long predated member methods, but if we were to write it again from scratch today, there are different decisions we would make!)
So the idea here is that any BIF (Built In Function) that operates on a data type would just be a member method if we were to design a language from scratch. This is how most other languages work and is pretty familiar outside of CF. I’ll also note, BoxLang doesn’t have any of the issues that plagued CF and Lucee for years where member methods wouldn’t always work on all data. Like how len( true ) was valid, but true.len() would error. CF/Lucee have mostly fixed those issues, and BL never had them. 🙂 If a value can be cast to the type, then it will work!
https://community.ortussolutions.com/t/boxlang-bif-member-methods/10293Ben Nadel Corner
6/3/24 - Blog - Ben Nadel - Using Range Offsets To Power Weighted Distributions In ColdFusionA few years ago, I looked at using arrays to power weighted distributions in ColdFusion. Using arrays is nice because they create a great visualization of the distributed values. But, creating and populating an array is a lot of overhead. As such, I wanted to revisit the idea of a weighted distribution of values; but, instead of populating an array, I'm just using calculated offsets.
https://www.bennadel.com/blog/4664-using-range-offsets-to-power-weighted-distributions-in-coldfusion.htm
6/25/24 - Blog - Ben Nadel - Core Decision Functions Will Accept Null / Undefined Values In ColdFusionColdFusion has always had a contentious relationship with null / undefined values. The ColdFusion runtime supports null and undefined values; but, if consumed incorrectly, such values lead to null reference errors. As such, it isn't always clear where you can and can't use undefined values. Today, I want to demonstrate that all of the core decision functions (such as isSimpleValue(), isArray(), and isStruct()) will accept null / undefined values; and, will do pretty much what you hoped they would do.
But first, we have to differentiate between referencing a null value and passing a null value. And, this is where much of the confusion (and runtime errors) come from.
https://www.bennadel.com/blog/4671-core-decision-functions-will-accept-null-undefined-values-in-coldfusion.htm
7/1/24 - Blog - Ben Nadel - Adobe ColdFusion Parses JSON Into Non-Ordered StructsIn ColdFusion, an ordered struct (aka linked struct) allows keys to be iterated in the same order in which they were defined. This is hugely valuable for workflows that involve MongoDB queries and Hashed Message Authentication Codes (HMAC). But, one quirky behavior that I came across today is that when Adobe ColdFusion parses JSON strings, it parses the object notation into an unordered struct. This means that you lose the "orderedness" through the serialization and deserialization workflow.
https://www.bennadel.com/blog/4675-adobe-coldfusion-parses-json-into-non-ordered-structs.htm7/12/24 - Blog - Ben Nadel - Normalizing Collection Entries In ColdFusionIn Lucee CFML, looping over collections is effortless because Lucee exposes both the key and value attributes on the CFLoop tag. Furthermore, you can even use struct instead of collection for a more intuitive read on the code. Unfortunately, Adobe ColdFusion hasn't caught up with these ergonomics niceties just yet. As such, I created a user defined function (UDF) that normalizes collections (Structs and Arrays) into an array that always exposes index, key, and value.
https://www.bennadel.com/blog/4684-normalizing-collection-entries-in-coldfusion.htm7/14/24 - Blog - Ben Nadel - OWASP Java Encoder Project Recommends Using Both URL and Attribute Encoding For HREF AttributesIn ColdFusion, whenever I'm constructing a dynamic URL, I always run the dynamic parts through the encodeForUrl() function in order to maintain URL integrity. But, if I then use that dynamic URL to populate an anchor tag's href attribute, I end up operating in nested contexts; and, I'm always left wondering if I should have used the encodeForHtmlAttribute() function instead. For more insight, I went to the OWASP Java Encoder documentation; and, according to their "Common Mistakes" section, I should actually be using both encoding methods.
https://www.bennadel.com/blog/4685-owasp-java-encoder-project-recommends-using-both-url-and-attribute-encoding-for-href-attributes.htm7/15/24 - Blog - Ben Nadel - Getting A Struct Key In Its Native Key-Casing In ColdFusionIn ColdFusion, structs are case-insensitive. This is very much a feature of the language, not a bug. But, in some rare edge-cases, I want to validate that the struct key I'm using has the same key-casing that the struct itself is using. There's no native ColdFusion function for this endeavor; so, I created the user defined function, structGetKey().
My particular use-case is that I have a struct acting as my data store. The user can view a detail page for each struct entry using a URL-provided key. What I want is to make sure that my detail page is always rendering the struct key as it's defined on the struct, not as provided in the URL.
https://www.bennadel.com/blog/4686-getting-a-struct-key-in-its-native-key-casing-in-coldfusion.htm7/18/24 - Blog - Ben Nadel - Using AttributeCollection To Manage Locking In ColdFusionThe other day, when I was demonstrating how to use an ordered struct as a fixed-size cache in ColdFusion, I had to synchronize access to the cache in order to limit the number of cache keys. Whenever I make a new demo, it gives me a chance to reconsider and experiment with different approaches. And, in the aforementioned demo, I used ColdFusion's attributeCollection functionality to define my CFLock tags. This felt like a rather elegant and easily consumable approach; and I wanted to showcase it more directly.
https://www.bennadel.com/blog/4689-using-attributecollection-to-manage-locking-in-coldfusion.htm8/1/24 - Blog - Ben Nadel - Code Isn't Magical, It's Just A Series Of CommandsThere is a sense at times, especially when starting a new framework, language, or codebase, before you know it, to assign magical powers to code. Ben compares it to “quantum entanglement” - a phenomenon where subatomic particles suddenly change properties if some corresponding particle’s properties change even if they are completely isolated, geographically separated and it seems to do so even faster than the speed of light would allow.
However, code doesn’t work like that - it’s a series of inputs, commands and outputs and if it feels like it’s acting like a magical blob there something that you don’t quite understand yet. This could be architecture, coding style, or ???
https://www.bennadel.com/blog/4693-code-isnt-magical-its-just-a-series-of-commands.htm8/1/24 - Blog - Ben Nadel – JavaScript Application Size Shouldn't Affect PerformanceAnd one sentiment that I've heard repeated a number of times across different podcasts is that as the size of a JavaScript application increases, its performance decreases. This is often touted as a reason to switch from one JavaScript framework to another—that some magical threshold has been reached. But, this sentiment makes little sense. The size of a JavaScript application should be completely disconnected from the performance of said application.
100,000 line data file will have issues regardless of library
https://www.bennadel.com/blog/4694-javascript-application-size-shouldnt-affect-performance.htmCFML JobsSeveral positions available on
https://www.getcfmljobs.com/Listing over 15 ColdFusion positions from 15 companies across 11 locations in 5 Countries.
3 new jobs listed in the last two months.
Contract — ColdFusion DeveloperVeredusCorp
Herndon, VA, United States
Posted July 18, 2024
https://www.getcfmljobs.com/jobs/index.cfm/united-states/ColdFusion-Dev-at-Herndon-VA/11643Full-Time — Senior ColdFusion DeveloperSerco
Pennsylvania, United States
Posted June 25, 2024
https://www.getcfmljobs.com/jobs/index.cfm/united-states/Senior-CFDeveloper/11642Contract — ColdFusion DeveloperNoralogic, Inc.
Richmond, VA, United States
Posted June 12, 2024
https://www.getcfmljobs.com/jobs/index.cfm/united-states/ColdFusionDev-at-Richmond-VA/11641Other Job Links
Mike Horne on X —
https://x.com/recantha/status/1820373668913987645ForgeBox Module of the Week
ColdBox Scheduled Task ManagerBy Giancarlo Gomez
Powerful and intuitive UI for displaying and managing scheduled tasks in your ColdBox application.
https://forgebox.io/view/scheduled-task-managerVS Code Hint, Tip, and Trick of the Week
VS Code ProfilesVisual Studio Code has hundreds of settings, thousands of extensions, and innumerable ways to adjust the UI layout to customize the editor. VS Code Profiles let you create sets of customizations and quickly switch between them or share them with others. This topic explains how to create, modify, export, and import profiles.
https://code.visualstudio.com/docs/editor/profilesIn this milestone, we continued to improve the Profiles Editor by making it more user-friendly and by having a look and feel that's consistent with the Settings Editor.
The Profiles Editor is available as an experimental feature behind the workbench.experimental.enableNewProfilesUI setting. Once enabled, you can access the Profiles Editor from the Settings gear icon in the bottom left corner of the window.
https://code.visualstudio.com/updates/v1_92#_profiles-editor-previewThank you to all of our Patreon SupportersThese individuals are personally supporting our open source initiatives to ensure the great toolings like CommandBox, ForgeBox, ColdBox, ContentBox, TestBox and all the other boxes keep getting the continuous development they need,
Their Contributions fund the cloud infrastructure at our community relies on like