Sunday, December 26, 2021

Advent of Code Is Done For The Year

We've come to the end of another year of Advent of Code. Apparently this year AoC saw the 10 millionth star issued since it began in 2015! Pretty impressive. Not sure of any final numbers yet, but I've heard there was again more participation this year than the previous year. The stats show that on Day 1, 190,118 people completed both parts and 22,274 additional people completed Part 1. And on Day 25, 7227 completed both parts with 4701 completing Part 1. Last year, more people stuck around to the end (quarantine-related?), but this year had far more participants. 

Pretty cool. 

I started the season with the framework I had begun building to quickly parse the inputs into a usable format, but I quickly realized that the inputs this year were a bit more complex than I was previously working on. I bailed on my framework and just resorted to simple day-by-day processing. I'll go back and refactor my earlier framework to include this year's processing needs. 

I'm not one of the Competitive Programmers who always top the AoC Leaderboard, but I did participate this year with a few other programmers from the Working Code Podcast's Discord server. Some used Python, and a couple of us used CFML. I created a Private Leaderboard for us so that we could at least see how we were doing against some of our peers. Considering that most of the Top 100 Public Leaderboard spots were filled within just a few minutes of puzzle release, I'm glad I did it. 

I didn't finish as many days as I wished I had. I only made it through Part 1 of Day 9 before time ran out. I ran into a huge stumbling block on Day 4 that really hung me up and killed my motivation. I gave it a few tries a couple of times, but kept getting wrong answers. I watched myself getting further and further behind, and just kinda set the whole thing aside for a few days. I finally went back to it and solved it, much easier than I thought I would, and realized I had been way over-thinking it. I tried to blast through as many as I could before time ran out, but stumbled again on Day 8. I managed to get the solution and knocked out Part 1 of Day 9, but struggled with Part 2 until I ran out of time. The biggest lesson I learned was to not try to do these late in the evening. And also, Off-By-One errors suck. 

Oh, and Python (which has been on my Things I Want To Learn list for way too long) is much more capable of handling these types of problems. ColdFusion can do it, but some of the processing seemed to be much more straightforward in some of the other language answers. 

I took notes on the days I did, and I need to finish writing them all up. 

A big thank you to Eric Wastl for creating this, and another big thank you to all who participated. I look forward to doing this again next year. 👍


Working Code Podcast Group 2021 Private Leader Board


Tuesday, December 7, 2021

Today I (re)Learned

Mark this up as a TI(re)L:

I've been working on the Advent of Code daily puzzles with some of the people on the Working Code Podcast Discord channel, and I said that one of the challenges I've had with some of these puzzles was simply parsing the Inputs into the format I planned to work with in CFML. Tim Cunningham (t) mentioned some code that would parse a CSV file:


private function setParseSettings(
    required string localFilePath,
    required string lineSeperator=CRLF,
    required string quoteEscape="\",
    required boolean parseUnescapedQuotes=true,
    required boolean keepFirstRow=false
) { ..... }

I looked at the code and thought "Why would you have a default value if the parameter is required?", so I asked. A long time ago I learned that a required parameter couldn't have a default value; that's what optional parameters are for. At least that's what I thought. I guess I haven't ever really thought about the way it works. 

In SQL Server, functions don't really have a concept of optional parameters. Stored Procedures do, but there isn't an explicit required attribute in either one. You simply define an optional parameter by giving it an "= something". There are a few gotchas with parameters in SQL functions and sprocs, but those are beyond the scope of my thoughts here. And since most of my current work is in SQL and not CFML, I never really came across it enough to think about it.

Back to what I didn't realize I had forgotten.... 

You CAN have both required and a default value in your parameter definitions, in CFML and in many, if not most, other languages.

I knew that, conceptually, if a parameter was required, then it didn't matter if it had a default value. You had to pass the parameter, and if you did, then the default value was replaced anyway. But that's where my thinking was backwards. When the function is evaluated, if an optional value is defined, the required definition is ignored. So even though an argument is labeled as required, it doesn't have to be passed if there is a default value.

I didn't think that made any sense, so I verified it.

<cfscript>
function testme( required String param1, required Boolean param2 = false ) {
    return {"param1":param1,"param2":param2}
}

writedump( testme("Bill") )
writedump( testme("Ted",true) )
writedump( testme(param2=true, param1="Rufus") )
writedump( testme() )
</cfscript>

Which gave me: 

Huh... I stand corrected. This was something that I used to know, but had completely forgotten, or at least overwrote my original memory with my later assumption of how it all went together. 

Apparently it's perfectly fine to not pass a "required" parameter as long as it has a default value. If no parameter is passed, the default is evaluated and the required is ignored. Which is probably why I got backwards in the first place. Why label a parameter as required if it isn't really?

I'm sure the old gods of programming had a legitimate reason for doing it that way, but it escapes me. 

Oh well.



Monday, November 1, 2021

Thursday, October 28, 2021

Hire This Person!


I don't want to condone anyone hacking anyone else, but this was an extremely awesome, non-destructive Senior Prank. 


And this young hacker did the responsible thing and did a full write-up and disclosure to the school district's IT personnel and helped them fix it. 

Bravo.





Press F12 and Become a Hacker Today! (aka: Why We Need More Cybersecurity Awareness Month)

Earlier this month, we had this...


And a .... what is it when you double-down a dozen times and keep doing it?

And even...

I have thoughts.... 

Starting with WTF???

I don't normally jump into political topics, but I don't really see this as political. I see this as a Governor who either refuses to listen to the people he hired to know about basic technology stuff, or he's hired a bunch of complete idiots. Though reading through some of the other articles, it appears to be a case of the former. 

Not only did auditors previously mention these issues, but the reporter did the responsible thing and privately disclosed this information before his report. Then, this extremely clueless Governor kept going with his statement, despite his ignorance being pointed out again and again and again on social media. 

So the reporter, Shaji Khan, absolutely deserves that apology, Gov. Parson.

And for those of you out there who are interested in this so-called "multi-step process" that was used, I'll give you the details. I'm completely opposed to discussing hacking "how-to"s in a public forum, but I'm fairly certain I used this "hack" to teach myself HTML about 20 years ago. 

Disclaimer: Browsers will vary slightly, and there are many more ways to accomplish this "hack".

Here goes...

If you're using Chrome, Right Click on a page ...

And click "View page source". (Or just click Ctrl-U)

You'll get a page with some funny-looking words on it, but don't worry. That's the "hacked" details of the page. 

There's also the super-secret, only-for-developers-and-hackers way to do this. Just press F12 and you can get that info and even more.

I can forgive any politician making a mistake, but to continue to go on and on about this "hack".

The words I had earlier seem insufficient. Although this does make a good story for Cybersecurity Awareness Month. 






Friday, October 22, 2021

Into The Box 2021 - Write Up - Post Day +1 - Saturday, September 25, 2021

 


I got invited to speak at the Into The Box 2021 Conference in Houston, TX. These are my thoughts.

-----------------------------------------------------------------------------

Good god it's early. Quick shower then downstairs to meet my Uber.

......

Waited for a few minutes and my Uber driver stopped around the corner, but he got me squared away and to the airport with plenty of time before my flight. Not one single issue going back through screening. I've got about 40 minutes before boarding starts. There are a surprising amount of people in the airport this early. The stupid sun isn't even up yet.

.... 

On the plane, and it's a fairly empty flight again. Message sent that I'm on my way home, and now to decide if I want to try to watch a movie or just chill. 

.....

Chill it was. Made it safely back to Nashville. The landing was probably one of the best landings I've ever seen. Not sure which pilot was flying this morning, but whichever it was squeeked it on at BNA. Very nice job. 

Got my bags picked up and now just waiting on the wife to pick me up and take me home.

...

And I am back home! And very tired.

........................................................

All in all, I had a _GREAT_ time at Into the Box. I got to see some people that I haven't been able to see in a while. There were a few people that I would have liked to have seen, too, but they couldn't make it. Things are still a little iffy with COVID, but it was kinda nice to be able to attend an in-person event again. I very much liked the hybrid nature of this conference, and I hope other conferences do the same. There are a lot that I haven't been able to attend in-person, and an online option would have been great. Granted, an extremely large part of any conference I've ever been to has been the "Hallway Track". So I don't think they should all go all-virtual. 

I want to offer a huge _Thank You_ to Ortus Solutions for having me speak again. They are now the group that has given me my first speaking opportunity (ITB 2019 Virtual) and my first in-person opportunity (ITB 2020 Hybrid).


I hope to see everyone again next year!


Shawn Oden 

September 30, 2021 

(written Sept 22 - 25)

(procrastination time - September 25 - October 22!)



Into The Box 2021 - Write Up - Day 2 - Friday, September 24, 2021


I got invited to speak at the Into The Box 2021 Conference in Houston, TX. These are my thoughts.

-----------------------------------------------------------------------------

The day started again with breakfast! <picture>

Thank you to Ortus for the great food. 

-----------------------------------------


Keynote: 

Reminder - Keynotes are available for free on cfcasts.com (https://cfcasts.com/series/into-the-box-2021/videos/keynote-day-2)


It began with Edgardo reminding us of his awesome dance moves from yesterday. It's definitely something to see. Even though you can't unsee it.

Also, Life is more than software.

Pause Breathe Resume


Ortus does a whole lot to help the community. Thank you to Ortus.


Next up is Luis again.

ContentBox 

  - 9th Anniversaries

  - 4.x Series 2018, 5.x Series 2021 (yesterday), 6 Beta in 2022, 6 Final in 2023, 7 Beta 2024

  - Main new features = Multi-site, Headless, Reactive Admin, CLI

  - Multi-site

      - Manage 1 or 1000 sites on one Box.

      - Detection through URI, Query String or Headers

      - Staging + Prod in one box

      - Copy/Clone/Move between sites

      - Export/Import

  - Headless CMS

      - Everything modularized. 

      - Expressive RESTful API

      - JWTs

      - Can be deployed as a single module

      - Consume from ANY language

    - Build self-documents

  - Reactive Admin

      - Using Alpine.js + Tailwind

      - CBWire Elements

      - Return Vanilla.js

  - CLI

    - contentbox-cli

      - Install ContentBox on any CFML Engine with any supported database

      - Automise entire content sites

  - ContentBox Cloud - CAAS Content as a Service

     - Bring your own UI

     - Beta Q2 2022

 

TestBox de facto standard for TDD and BDD in CFML dev

  - 7th Anniversary.

  - 734K installations

  - 4.x Series April 2020

     - 5 releases, 1 coming soon

  - 5.x series planning has started.

  

  - output utilities through `request.testbox` or console or CF output buffer.

  - updated reporters - Easier to read

  

  Mocking (MockdataCFC rewrite)

     - Over 15 mocking types

    - Can also be a mocking HTTP REST Service, a CFML app or a ColdBox module.

  

  IDE Integration

  

Now Jon Clausen ("Captain Container")

State of the Container

   - more ubiquitous

   - Orchestration tools evolve (Docker Swarm, Kubernetes, Portainer, Ranger)

   - Usage of containers for Cron and Lambda

   - Swarm Stacks and Kube Workflows make full stack deployments (almost) trivial


   - Docker Commandbox has almost 1.3M pulls!

     - 6 releases in 2021

     - Tighter integration with Commandbox

     - Multi-Architecture support - (also supports ARM)

     - ACF 2021 Support

     - Lucee Lite Builds

     - Don't forget MiniBox (Pete Freitag) (with Docker Commandbox)

  

  - StacheBox

    - Logging and Bug Tracking framework for Coldbox

    - Javascript bug logging system which integrates with the module.

    - Can run as a module or as standalone

    - Can aggregate data between multiple log indexes and track occurrences.


    ortussolutions.org/stachebox

    stachebox.ortusbooks.com


  - cbElasticsearch  (lowest barrier of entry for advanced elasticsearch with CFML apps)

    - 23K installs

    - PATCH API support

    cbelasticsearch.ortusbooks.com


  - CommandBox containers make your life easier.

 

Next up Eric Peterson - Lead module architect


- qb  = queryBuilder  (Last year = 37 releases and 18 contributors)

  - Optional strict date detection

  - computed and virtual columns

  - Dump Helper - dump dump == debug query contents

  - table locks

  - auto scale for decimals and floats

  - Now handles Upserts


- Quick (26 rel, 11 contrib)

  - ORM for ColdBox

  - "Up and Running with Quick" workshop on CFCasts - 

  - NEW:

      - JSON and Boolean Casts

      - Easy return relationship counts

      - Parent/Child


- cbDebugger

  - Mini-APM (Application Performance Monitoring)

  - works with API requests 

  - qb, Quick and cbORM reporting

  - Quasar App coming soon

  

  -  Word Cloud of modules that have recently been updated <pic>


- CFCasts (modern CFML content)

  - 21 Series, 311 Videos, 85 FREE

  - 100 hours of content

  - over 450 registrations. 


Next up: Michael Born  (Sr Ortusian Dev)

  - DocBox Lives!

    - Documentation Library that reads code metadata and generates documentation.

    - Machine readable docs

    - Added multi-output format

    = docbox.ortusbooks.com

  

  - cbORM (sane way to work with Hibernate)

    - chainable human DSL

    - Java streams support

    - native array of structs

   - Partnered with Lucee to upgrade Hibernate extension.

      - moves imbedded Hibernate forward a full decade.

     - Breaking change in 5.4 == positional parameters (update to new JPA syntax)


Finally, Gavin Pickin (The Balrog of NZ)

  - Ortus Podcasts

     - "Let us be the voices in your head."

     - Modernize or Die CFML News Edition - Approx 14K listens + 10K YouTube watches over 125 episodes.

       - About 40 minutes, weekly, Tuesdays

    - Bringing back SoapBox Edition

      - Hosted by Luis Majano

      - Longer format - 30-60 minutes

      - Monthly


And the Keynote has come to an end. 


"Go Forth and Conquer!"



Once again, they have shown me even more "Box" goodies that I don't know enough about. QB and Quick look pretty cool. I need to flag down Eric later to ask about QB.


-----------------------------------------



SESSION 1 - Using Commandbox to optimize your daily workflow - Scott Steinbeck

CommandBox is a full-featured CLI tool written in CFML that streamlines your workflow. We will be navigating through many of the features included out of the box such as: command aliases, environment variables, enhanced terminal commands, JSON/File search & filter, watch tasks, as well as other Box product built in commands. Then we will explore extended features provided by published CommandBox modules and your own custom modules and task runners. 

=============


- What is Commandbox?


`box start cfengine="none"` >>> gives a plain HTML server! Very cool. 


- To learn more, go to the docs. There's a _TON_ of info about what CommandBox can do.


`server list running`

`server stop all`


- Environment Vars Overrides!

  - `env set cfconfig_AdminPassword "P@ssW0rd"`


67 Commandbox modules in total.

   - CFDocs

   - Bullettrain


-----------------------------------------


    

SESSION 2 - How to create high performance teams - Stephanie Monge

There is no secret recipe to create high-performance teams, however, we will share some valuable tips that will help you look over yourself and your team to find improvement opportunities that will boost your team performance and growth.

=============


"Man is, by nature, a social animal." = Aristotle

"I am because We are." - Ubuntu


-----------------------------------------


LUNCH TIME!


Pulled pork! Baked beans. Bread. Smells fantastic! But....

My session is right after lunch. There's absolutely _NO WAY_ I'm going to eat anything beforehand.


But I grabbed a plate and stashed it in my preso room. I'll eat after my talk.


-----------------------------------------


SESSION 3 - Don't Go Breakin' My Heart: Trust, But Verify  = Shawn Oden

September is Insider Threat Awareness Month. So let's talk a little cybersecurity. Insider threats are a problem that every business should watch out for.

=============

September is Insider Threat Awareness Month. So let's talk a little cybersecurity. Insider threats are a problem that every business should watch out for. To function, any business must trust their employees. But, sometimes, that trust can be abused to disastrous ends. In this talk, I'll go over some of the basics of Insider Threat Awareness, and I'll show some examples of real Insider Threats and how they could have been seen coming. 

=============

MY SLIDES

This was my talk. First time talking in front of more than a few people in forever. I hope it went well. 


About half way through, the hotel wifi went out, so I completely lost my Zoom audience. It took me a few minutes to get reconnected and back on with everyone. So my recording will be broken.


That got me about 10 minutes behind, so I had to rush through the last half of my preso. I ended it about 10 minutes late. Fortunately, Charlie Arehart was after me, so he was able to adjust his preso and catch back up. Thanks a ton, Charlie!


NOTE: Before my preso, I was talking with Dan Card. He liked my background. Said it was very "Usual Suspects", and he mentioned that Office Space would be a good fit for my topic. :-)


-----------------------------------------


SESSION 4 - Considering Monitoring Solutions for CF and Lucee

Charlie Arehart

If you're suffering performance and stability problems, there's no substitute for having SOME kind of monitoring in place. But there are quite a variety of monitoring solutions available for ColdFusion and Lucee. How do you choose? (Or are they "all the same"? No!) 

=====

There may be some monitoring features built-into your CFML engine (and free), which perhaps you didn't even know about--or it may depend on which version of the engine you're running. There are also commercial third-party monitoring tools, built for CF and Lucee. And there are still other Java monitoring tools (some free, some commercial), which can be used readily with CF and Lucee. So many choices, but which is best for you? In this session, we'll review several of these monitoring alternatives, and which are available for various releases of CF and Lucee. We'll identify several goals (problems to be solved or features one may seek). With this information, one can better determine if a built-in tool may suffice, or better choose among other options that would best meet their specific needs, including whether having more than one tool (yes, more than monitor against a single instance) may be the best way to satisfy different needs. 

=====


Again, thank you, Charlie, for being a super-professional. I wanted to watch this whole talk, but I already made him start late, and I was hungry. I wanted my lunch that I stashed away. But the awesome hotel staff were a bit too efficient. Someone found my stashed plate and cleaned it up. 


Fortunately, they were still cleaning up the lunch service, so I was able to fix myself another plate. It was cold, but it was still very tasty. 


I got to eat while I watched the last half of Charlie's preso. Sadly, I didn't take any real notes, other than a tiny one about Challenges of Scale (1vs7000 servers) and a note about CFStat and ListMetricData().


I'll look up his slides later. He's always full of good info. 


-----------------------------------------


SESSION 5 - Testing APIs with TestBox

Javier Quintero


Ready to start testing your CFML apps but not sure how to do it right? In this session, you will learn how to test your app whether is a ColdBox app or not. I will guide you and show you the benefits of using TestBox when writing API tests. Remember, writing tests is a vital part of the development process, make sure you write tests for your existing and new apps. Do it often and take advantage of the features and benefits that TestBox has in the store for you. 

======================


Server Error Code Families

1xx Info

2xx Success

3xx Redirect

4xx Client Error

5xx Server Error


Coldbox Relax --  `box install relax`


-----------------------------------------


SESSION 6 - Quick - Scopes, Relationships, and Patterns

Eric Peterson


Come learn how Quick can help you improve the readability of your code, not just represent SQL as Objects. 1. Give relevant names to important collections of SQL code. (scopes, relationships, etc.) 2. Make queries easy to compose at runtime to get the exact data you want in the most efficient way (subselects, eager loading, etc.) 3. Get out of your way when you need or want to write barebones SQL.

======================


- Quick is the ColdBox ORM engine. 

- Scope - How to organize SQL objects

- cbDebugger - get your queries that are generated

- Workshops on CFCasts!


-----------------------------------------


And we're done. Almost. We've got the closing and the final Raffle.....


-----------------------------------------


Sweet! I won an Amazon Echo Auto!


And now we're really done. :-(


-----------------------------------------


I tried to switch my flight to leave tonight, but I couldn't get it done. Because I was trying to fly out of IAH instead of HOU, I'd have to talk to an agent. And with a 40 minute expected wait, I'd be cutting it _EXTREMELY_ close to switch my plane then find an Uber that could get me to the airport. I guess I'll stick to my original flight and leave in the morning. 


.........


Since I'm sticking around for the evening, I'm going to walk back down to the restaurant we went to the other day to grab some grub.


....


That place was _PACKED_! I walked back down to Goode Company and ordered an Old No. 7. It was some of the best Tex-Mex I think I've ever had. Though, to be fair, I'm in Houston, which already has great Tex-Mex, and it's been a couple of decades since I've been in this part of the country. They gave me a ton of food, more than I was able to eat, to be honest, and I would _HIGHLY_ recommend this place again (https://kitchenandcantina.com/menus/the-woodlands/). 


Now that I'm stuffed, it's time to wind down and go to bed. I've got to be up _REALLY_ early to check out and meet my Uber at 5 A.M.