2023/11/02 10:31:20: Generated dev website from groovy-website@19c1a4a
diff --git a/blog/community-over-code-na-2023.html b/blog/community-over-code-na-2023.html
index 3c034e5..887ceea 100644
--- a/blog/community-over-code-na-2023.html
+++ b/blog/community-over-code-na-2023.html
@@ -125,7 +125,9 @@
<p>The Groovy track was spread over the first two days of the conference and had ten sessions
as well as a <em>birds-of-a-feather</em> session after the first day.
The sessions typically had mini-themes: Groovy update, for Java developers, Kubernetes and Groovy,
-Groovy and Data Science (this year featuring Apache Ignite) and so on.</p>
+Groovy and Data Science (this year featuring Apache Ignite) and so on.
+Here we’ll just look at a few highlights of each talk. You are encouraged to peruse
+the slides and other content if you want more details.</p>
</div>
<div class="sect2">
<h3 id="_groovy_update">Groovy update</h3>
@@ -149,7 +151,7 @@
3 million downloads per day on average.</p>
</li>
<li>
-<p>Groovy supports classes and scripts but with JEP 445 scripting on the way in Java (preview in JDK21),
+<p>Groovy already supports classes and scripts but with JEP 445 scripting on the way in Java (preview in JDK21),
Groovy 5 supports additional forms so that JEP 445 code examples will run straight in Groovy (for JDK11+).</p>
<div class="listingblock">
<div class="content">
@@ -163,7 +165,7 @@
and variations which retain Groovy’s extra features like access to the script binding and context.
The <code>run</code> method is used instead of the <code>main</code> method to gain the traditional Groovy script features.
An added bonus is that Groovy’s <code>@Field</code> annotation isn’t needed to designate fields within JEP 445-like scripts.
-Here is another example:</p>
+Here is another example, this one using Jackson data binding to serialize itself as a JSON file:</p>
</div>
<div class="listingblock">
<div class="content">
@@ -189,9 +191,13 @@
<li>
<p>An additional <code>@OperatorRename</code> AST transform is now available which makes it easier to use
a multitude of libraries with Groovy’s operator overloading. This is handy when working with
-packages that might manipulate complex numbers, matrices, or fractions (as per the example below
+libraries that might manipulate complex numbers, matrices, or fractions (as per the example below
which uses the Apache Commons Numbers Fraction library).
-Such libraries can now easily be used with the operator overloading feature.</p>
+Previously, you may have forgone using the operator overloading shortcuts,
+or you (or someone else) would have possibly written some Groovy specific
+extension methods to provide the nicer operator overloading syntactic sugar for a particular library
+of interest. Now, such libraries can now easily be used straight out-of-the-box
+with the operator overloading feature.</p>
<div class="listingblock">
<div class="content">
<pre class="prettyprint highlight"><code data-lang="groovy">@OperatorRename(plus='add')
@@ -296,7 +302,8 @@
</div>
</li>
<li>
-<p>Groovy gives you powerful switch expressions:
+<p>While we like, many of the exciting changes for switch expressions coming along with
+recent Java versions, Groovy still provides numerous additional options (for JDK8+):
<span class="image"><img src="img/Groovy2023Switch.png" alt="Groovy switch expressions"></span></p>
</li>
<li>
@@ -307,7 +314,8 @@
easier by Groovy’s AST transforms. The slides have examples of combining
records with the following AST transforms:
<code>@PropertyOptions</code>, <code>@ToString</code>, <code>@Memoized</code>, <code>@Builder</code>,
-<code>@Requires</code>, <code>@Sortable</code>, <code>@Newify</code>, and <code>@OperatorRename</code>.</p>
+<code>@Requires</code>, <code>@Sortable</code>, <code>@Newify</code>, and <code>@OperatorRename</code>.
+But of course, you aren’t limited to just that list.</p>
</li>
</ul>
</div>
@@ -322,7 +330,8 @@
<p>Groovy for Java Developers</p>
</div>
<div class="paragraph">
-<p>Testing your Java with Groovy, Spock, JUnit5, Jacoco, Jqwik and Pitest</p>
+<p>The next talk was
+<a href="https://speakerdeck.com/paulk/property-based-testing">Testing your Java with Groovy, Spock, JUnit5, Jacoco, Jqwik and Pitest</a>.</p>
</div>
</div>
<div class="sect2">
@@ -346,15 +355,20 @@
<p>The sample application was a simple solution to the
<a href="https://en.wikipedia.org/wiki/Collatz_conjecture">Collatz conjecture</a>.
I remember studying this back in my Uni days but had forgotten the details.
-Basically one of two calculations is performed, depending on whether the
-current result is even. Eventually, the result always equals 1.
-Of interest is the number of cycles needed to get to 1.
+Basically, given a starting number, one of two calculations is performed,
+depending on whether the current number is even.
+Odd numbers are multiplied by 3 and then 1 is added, even numbers are divided by 2.
+This is stopped if the result becomes the number 1, but otherwise continues.
+The conjecture is that eventually, the calculation terminates, i.e. it always eventually equals 1.</p>
+</div>
+<div class="paragraph">
+<p>Of interest is the number of cycles needed to get to 1.
Here is an algorithm that returns the number of cycles:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="prettyprint highlight"><code data-lang="groovy">class Collatz {
- static long getAt(BigInteger n){
+ static long getAt(BigInteger n) {
var result = n
var count = 0L
while (result != 1G) {
@@ -372,7 +386,8 @@
</div>
</div>
<div class="paragraph">
-<p>We can test out some of the example sequences mentioned in the <a href="https://en.wikipedia.org/wiki/Collatz_conjecture">Wikipedia page</a>:</p>
+<p>We used a static <code>getAt</code> method to give us a neat shorthand for getting the result.
+We can test out some of the example sequences mentioned in the <a href="https://en.wikipedia.org/wiki/Collatz_conjecture">Wikipedia page</a>:</p>
</div>
<div class="listingblock">
<div class="content">
@@ -396,6 +411,10 @@
</div>
</div>
<div class="paragraph">
+<p>We’ve shown some example features you might want to use.
+You could add further features depending on your application’s needs.</p>
+</div>
+<div class="paragraph">
<p>We can change the skeleton controller to have our desired functionality:</p>
</div>
<div class="listingblock">
@@ -414,7 +433,27 @@
deploying the application.</p>
</div>
<div class="paragraph">
-<p>Let Groovy operate your k8s cluster</p>
+<p>Jorge also presented the next talk: <a href="https://communityovercode.files.wordpress.com/2023/10/sat_groovy_let_groovy_operate_your_cluster-jorge.pdf">Let Groovy operate your k8s cluster</a>.
+This dived into more k8s details. He showed how to write a swagger-operator in Groovy
+which removed the need for tedious manual steps when deploying k8s applications.
+The operator monitors our services, rewrites the configmap if needed and restarts the pod.</p>
+</div>
+<div class="paragraph">
+<p>The operator itself was written in <a href="https://micronaut.io/">Micronaut</a>:</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="prettyprint highlight"><code data-lang="groovy">@Operator(
+ informer = @Informer(
+ apiType = V1Swagger,
+ apiListType = V1SwaggerList,
+ apiGroup = V1SwaggerWrapper.GROUP,
+ resourcePlural = V1SwaggerWrapper.PLURAL,
+ resyncCheckPeriod = 10000L)
+)
+class SwaggerOperator implements ResourceReconciler<V1Swagger>{
+}</code></pre>
+</div>
</div>
</div>
<div class="sect2">
diff --git a/blog/img/HalifaxWhisky.png b/blog/img/HalifaxWhisky.png
index 6d11d03..8e1aef6 100644
--- a/blog/img/HalifaxWhisky.png
+++ b/blog/img/HalifaxWhisky.png
Binary files differ