You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by gi...@apache.org on 2023/11/14 06:01:20 UTC
(groovy-dev-site) branch asf-site updated: 2023/11/14 06:01:17: Generated dev website from groovy-website@0c10d60
This is an automated email from the ASF dual-hosted git repository.
git-site-role pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/groovy-dev-site.git
The following commit(s) were added to refs/heads/asf-site by this push:
new 6616d24 2023/11/14 06:01:17: Generated dev website from groovy-website@0c10d60
6616d24 is described below
commit 6616d24bd5d95ea0a9c3ea0230bf43ef7c944cd4
Author: jenkins <bu...@apache.org>
AuthorDate: Tue Nov 14 06:01:17 2023 +0000
2023/11/14 06:01:17: Generated dev website from groovy-website@0c10d60
---
blog/adventures-with-groovyfx.html | 2 +-
blog/deep-learning-and-eclipse-collections.html | 2 +-
blog/feed.atom | 10 ++++
blog/fruity-eclipse-collections.html | 2 +-
blog/helloworldemoji.html | 2 +-
blog/img/SetOperators.png | Bin 0 -> 13351 bytes
blog/index.html | 4 +-
...demoji.html => set-operations-with-groovy.html} | 52 +++++++++++++++++----
blog/zipping-collections-with-groovy.html | 2 +-
9 files changed, 61 insertions(+), 15 deletions(-)
diff --git a/blog/adventures-with-groovyfx.html b/blog/adventures-with-groovyfx.html
index 439165d..45dc8b5 100644
--- a/blog/adventures-with-groovyfx.html
+++ b/blog/adventures-with-groovyfx.html
@@ -53,7 +53,7 @@
</ul>
</div>
</div>
- </div><div id='content' class='page-1'><div class='row'><div class='row-fluid'><div class='col-lg-3'><ul class='nav-sidebar'><li><a href='./'>Blog index</a></li><li class='active'><a href='#doc'>Adventures with GroovyFX</a></li><li><a href='#_further_information' class='anchor-link'>Further information</a></li></ul><br/><ul class='nav-sidebar'><li style='padding: 0.35em 0.625em; background-color: #eee'><span>Related posts</span></li><li><a href='./deep-learning-an [...]
+ </div><div id='content' class='page-1'><div class='row'><div class='row-fluid'><div class='col-lg-3'><ul class='nav-sidebar'><li><a href='./'>Blog index</a></li><li class='active'><a href='#doc'>Adventures with GroovyFX</a></li><li><a href='#_further_information' class='anchor-link'>Further information</a></li></ul><br/><ul class='nav-sidebar'><li style='padding: 0.35em 0.625em; background-color: #eee'><span>Related posts</span></li><li><a href='./set-operations-w [...]
<div class="sectionbody">
<div class="paragraph">
<p>This blog looks at a <a href="http://groovyfx.org/">GroovyFX</a> version of a <a href="https://donraab.medium.com/my-weird-and-wonderful-first-adventures-with-javafx-6efe3b1923c8">ToDo application originally written in JavaFX</a>.
diff --git a/blog/deep-learning-and-eclipse-collections.html b/blog/deep-learning-and-eclipse-collections.html
index 830b3e5..c38aafe 100644
--- a/blog/deep-learning-and-eclipse-collections.html
+++ b/blog/deep-learning-and-eclipse-collections.html
@@ -53,7 +53,7 @@
</ul>
</div>
</div>
- </div><div id='content' class='page-1'><div class='row'><div class='row-fluid'><div class='col-lg-3'><ul class='nav-sidebar'><li><a href='./'>Blog index</a></li><li class='active'><a href='#doc'>Deep Learning and Eclipse Collections</a></li><li><a href='#_setting_up_our_model_and_data' class='anchor-link'>Setting up our model and data</a></li><li><a href='#_applying_deep_learning' class='anchor-link'>Applying deep learning</a></li></ul><br/><ul class='nav-sidebar' [...]
+ </div><div id='content' class='page-1'><div class='row'><div class='row-fluid'><div class='col-lg-3'><ul class='nav-sidebar'><li><a href='./'>Blog index</a></li><li class='active'><a href='#doc'>Deep Learning and Eclipse Collections</a></li><li><a href='#_setting_up_our_model_and_data' class='anchor-link'>Setting up our model and data</a></li><li><a href='#_applying_deep_learning' class='anchor-link'>Applying deep learning</a></li></ul><br/><ul class='nav-sidebar' [...]
<div class="sectionbody">
<div class="paragraph">
<p>In previous blogs, we’ve covered
diff --git a/blog/feed.atom b/blog/feed.atom
index 3204067..35f1d64 100644
--- a/blog/feed.atom
+++ b/blog/feed.atom
@@ -734,4 +734,14 @@
<published>2023-10-26T17:00:00+00:00</published>
<summary>This post looks at the ASF Community Over Code conference in Halifax, Nova Scotia, October 7-10 2023, with a particular focus on the Groovy Track.</summary>
</entry>
+ <entry>
+ <author>
+ <name>Paul King</name>
+ </author>
+ <title>Set Operators with Groovy</title>
+ <link href="http://groovy.apache.org/blog/set-operations-with-groovy"/>
+ <updated>2023-11-14T15:22:57+00:00</updated>
+ <published>2023-11-14T15:22:57+00:00</published>
+ <summary>This blog looks at union, intersection, difference &amp; symmetric difference operators in Groovy.</summary>
+ </entry>
</feed>
diff --git a/blog/fruity-eclipse-collections.html b/blog/fruity-eclipse-collections.html
index fef23cb..8caaec3 100644
--- a/blog/fruity-eclipse-collections.html
+++ b/blog/fruity-eclipse-collections.html
@@ -53,7 +53,7 @@
</ul>
</div>
</div>
- </div><div id='content' class='page-1'><div class='row'><div class='row-fluid'><div class='col-lg-3'><ul class='nav-sidebar'><li><a href='./'>Blog index</a></li><li class='active'><a href='#doc'>Fruity Eclipse Collections</a></li><li><a href='#_eclipse_collections_fruit_salad' class='anchor-link'>Eclipse Collections Fruit Salad</a></li><li><a href='#_exploring_emoji_colors' class='anchor-link'>Exploring emoji colors</a></li><li><a href='#_putting_it_all_together' [...]
+ </div><div id='content' class='page-1'><div class='row'><div class='row-fluid'><div class='col-lg-3'><ul class='nav-sidebar'><li><a href='./'>Blog index</a></li><li class='active'><a href='#doc'>Fruity Eclipse Collections</a></li><li><a href='#_eclipse_collections_fruit_salad' class='anchor-link'>Eclipse Collections Fruit Salad</a></li><li><a href='#_exploring_emoji_colors' class='anchor-link'>Exploring emoji colors</a></li><li><a href='#_putting_it_all_together' [...]
<div class="sectionbody">
<div class="paragraph">
<p>This blog post continues on the theme of using fruit emoji from the
diff --git a/blog/helloworldemoji.html b/blog/helloworldemoji.html
index e53cb28..d86d72e 100644
--- a/blog/helloworldemoji.html
+++ b/blog/helloworldemoji.html
@@ -53,7 +53,7 @@
</ul>
</div>
</div>
- </div><div id='content' class='page-1'><div class='row'><div class='row-fluid'><div class='col-lg-3'><ul class='nav-sidebar'><li><a href='./'>Blog index</a></li><li class='active'><a href='#doc'>Hello World with Emojis</a></li></ul><br/><ul class='nav-sidebar'><li style='padding: 0.35em 0.625em; background-color: #eee'><span>Related posts</span></li><li><a href='./deep-learning-and-eclipse-collections'>Deep Learning and Eclipse Collections</a></li><li><a href='./a [...]
+ </div><div id='content' class='page-1'><div class='row'><div class='row-fluid'><div class='col-lg-3'><ul class='nav-sidebar'><li><a href='./'>Blog index</a></li><li class='active'><a href='#doc'>Hello World with Emojis</a></li></ul><br/><ul class='nav-sidebar'><li style='padding: 0.35em 0.625em; background-color: #eee'><span>Related posts</span></li><li><a href='./set-operations-with-groovy'>Set Operators with Groovy</a></li><li><a href='./deep-learning-and-eclips [...]
<p>In a <a href="https://groovy.apache.org/blog/jvm-hello-world-with-groovy">previous blog post</a>
we took an in-depth look at how to write a "hello world" class at the bytecode level
using various libraries.</p>
diff --git a/blog/img/SetOperators.png b/blog/img/SetOperators.png
new file mode 100644
index 0000000..dc51ead
Binary files /dev/null and b/blog/img/SetOperators.png differ
diff --git a/blog/index.html b/blog/index.html
index e98d199..4f4d4e0 100644
--- a/blog/index.html
+++ b/blog/index.html
@@ -53,7 +53,7 @@
</ul>
</div>
</div>
- </div><div id='content' class='page-1'><div class='row'><div class='row-fluid'><div class='col-lg-3' id='blog-index'><ul class='nav-sidebar list'><li class='active'><a href='/blog/'>Blogs</a></li><li><a href='community-over-code-na-2023'>Community Over Code (North America) 2023</a></li><li><a href='chatgpt-one-liners'>ChatGPT meets Groovy one-liners</a></li><li><a href='groovy-pekko-gpars'>Using Apache Pekko actors and GPars actors with Groovy</a></li><li><a href= [...]
+ </div><div id='content' class='page-1'><div class='row'><div class='row-fluid'><div class='col-lg-3' id='blog-index'><ul class='nav-sidebar list'><li class='active'><a href='/blog/'>Blogs</a></li><li><a href='set-operations-with-groovy'>Set Operators with Groovy</a></li><li><a href='community-over-code-na-2023'>Community Over Code (North America) 2023</a></li><li><a href='chatgpt-one-liners'>ChatGPT meets Groovy one-liners</a></li><li><a href='groovy-pekko-gpars'> [...]
<div class='row'>
<div class='colset-3-footer'>
<div class='col-1'>
@@ -97,7 +97,7 @@
colors: am5.ColorSet.new(root, {})
}));
wc.data.setAll([
- { category: "concurrency", value: 2 }, { category: "groovy", value: 73 }, { category: "actors", value: 2 }, { category: "pekko", value: 1 }, { category: "gpars", value: 2 }, { category: "calendar", value: 1 }, { category: "date", value: 3 }, { category: "jsr310", value: 1 }, { category: "time", value: 1 }, { category: "data science", value: 7 }, { category: "eclipse collections", value: 9 }, { category: "kmeans", value: 3 }, { category: "emoji", value: 5 }, { category: "v [...]
+ { category: "concurrency", value: 2 }, { category: "groovy", value: 74 }, { category: "actors", value: 2 }, { category: "pekko", value: 1 }, { category: "gpars", value: 2 }, { category: "calendar", value: 1 }, { category: "date", value: 3 }, { category: "jsr310", value: 1 }, { category: "time", value: 1 }, { category: "data science", value: 7 }, { category: "eclipse collections", value: 9 }, { category: "kmeans", value: 3 }, { category: "emoji", value: 6 }, { category: "v [...]
]);
wc.labels.template.setAll({
paddingTop: 5,
diff --git a/blog/helloworldemoji.html b/blog/set-operations-with-groovy.html
similarity index 70%
copy from blog/helloworldemoji.html
copy to blog/set-operations-with-groovy.html
index e53cb28..66bfd37 100644
--- a/blog/helloworldemoji.html
+++ b/blog/set-operations-with-groovy.html
@@ -3,7 +3,7 @@
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]--><head>
- <meta charset='utf-8'/><meta http-equiv='X-UA-Compatible' content='IE=edge'/><meta name='viewport' content='width=device-width, initial-scale=1'/><meta name='keywords' content='groovy, emoji'/><meta name='description' content='This post looks at a Groovy hello world with some emoji fun.'/><title>The Apache Groovy programming language - Blogs - Hello World with Emojis</title><link href='../img/favicon.ico' type='image/x-ico' rel='icon'/><link rel='stylesheet' type='text/css' href='../ [...]
+ <meta charset='utf-8'/><meta http-equiv='X-UA-Compatible' content='IE=edge'/><meta name='viewport' content='width=device-width, initial-scale=1'/><meta name='keywords' content='groovy, emoji, set'/><meta name='description' content='This blog looks at union, intersection, difference & symmetric difference operators in Groovy.'/><title>The Apache Groovy programming language - Blogs - Set Operators with Groovy</title><link href='../img/favicon.ico' type='image/x-ico' rel='icon'/><li [...]
</head><body>
<div id='fork-me'>
<a href='https://github.com/apache/groovy'>
@@ -53,17 +53,53 @@
</ul>
</div>
</div>
- </div><div id='content' class='page-1'><div class='row'><div class='row-fluid'><div class='col-lg-3'><ul class='nav-sidebar'><li><a href='./'>Blog index</a></li><li class='active'><a href='#doc'>Hello World with Emojis</a></li></ul><br/><ul class='nav-sidebar'><li style='padding: 0.35em 0.625em; background-color: #eee'><span>Related posts</span></li><li><a href='./deep-learning-and-eclipse-collections'>Deep Learning and Eclipse Collections</a></li><li><a href='./a [...]
-<p>In a <a href="https://groovy.apache.org/blog/jvm-hello-world-with-groovy">previous blog post</a>
-we took an in-depth look at how to write a "hello world" class at the bytecode level
-using various libraries.</p>
+ </div><div id='content' class='page-1'><div class='row'><div class='row-fluid'><div class='col-lg-3'><ul class='nav-sidebar'><li><a href='./'>Blog index</a></li><li class='active'><a href='#doc'>Set Operators with Groovy</a></li></ul><br/><ul class='nav-sidebar'><li style='padding: 0.35em 0.625em; background-color: #eee'><span>Related posts</span></li><li><a href='./deep-learning-and-eclipse-collections'>Deep Learning and Eclipse Collections</a></li><li><a href='. [...]
+<p><a href="https://twitter.com/TheDonRaab">Donald Raab</a> posted an article about set operators using Java collections and <a href="https://github.com/eclipse/eclipse-collections">Eclipse Collections</a>. That post focuses
+on the <em>union</em>, <em>intersection</em> and <em>difference</em> operators. We’ll add in
+<em>symmetric difference</em> since Groovy supports operator overloading for that
+operator also.</p>
</div>
<div class="paragraph">
-<p>Let’s go the other way and look at a really fun way to write such a class with
-kudos to <a href="https://twitter.com/hugs">Jason Huggins</a> for the <a href="https://twitter.com/hugs/status/1642004520874942464">idea</a>. It’s all in the picture:</p>
+<p>First, a quick refresh about the operators for two sets <strong>A</strong> and <strong>B</strong>:</p>
</div>
<div class="paragraph">
-<p><span class="image"><img src="img/helloworld.png" alt="code for hello world"></span></p>
+<p><span class="image"><img src="img/SetOperators.png" alt="SetOperators"></span></p>
+</div>
+<div class="paragraph">
+<p>We’ll use the same emoji sets from Donald’s post:</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="prettyprint highlight"><code data-lang="groovy">Set OCT = ["🍁", "🍃", "🎃", "🥧", "🍫", "🌝", "👻", "🌽", "🍎", "🪵", "☕️"]
+Set NOV = ["🍂", "🍁", "🥧", "🦃", "🌽", "🍎", "🪵", "☕️"]
+Set DEC = ["🥧", "🦃", "⛄️", "🍎", "🌰", "🛷", "🪵", "🎄", "☕️"]</code></pre>
+</div>
+</div>
+<div class="paragraph">
+<p>Groovy lets you write the same code as in Donald’s post but also offers
+operator overloading for these operators as follows:</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="prettyprint highlight"><code data-lang="groovy">assert (OCT & NOV & DEC) == ["🪵", "🥧", "🍎", "☕️"] as Set
+
+assert (OCT | NOV | DEC) == ["🪵", "🦃", "🌰", "🛷", "🍎", "🎄",
+ "🍫", "🌝", "☕️", "🥧", "⛄️", "🍁",
+ "🍂", "🍃", "👻", "🌽", "🎃"] as Set
+
+assert (OCT - NOV - DEC) == ["🍫", "🌝", "🍃", "👻", "🎃"] as Set
+assert (NOV - OCT - DEC) == ["🍂"] as Set
+assert (DEC - OCT - NOV) == ["🎄", "🌰", "⛄️", "🛷"] as Set
+
+assert (OCT ^ NOV ^ DEC) == ['⛄️', '🌰', '🛷', '🎄', '🍃', '🎃', '🍫', '🌝',
+ '👻', '🍂', '🥧', '🍎', '🪵', '☕️'] as Set
+assert (NOV ^ OCT ^ DEC) == ['🍂', '🍃', '🎃', '🍫', '🌝', '👻', '🥧', '⛄️',
+ '🍎', '🌰', '🛷', '🪵', '🎄', '☕️'] as Set</code></pre>
+</div>
+</div>
+<div class="paragraph">
+<p>Since operator overloading is extensible in Groovy, you can have similar
+shorthand notation for your domain objects also. Enjoy!</p>
</div></div></div></div></div><footer id='footer'>
<div class='row'>
<div class='colset-3-footer'>
diff --git a/blog/zipping-collections-with-groovy.html b/blog/zipping-collections-with-groovy.html
index a1ab2ea..91466a6 100644
--- a/blog/zipping-collections-with-groovy.html
+++ b/blog/zipping-collections-with-groovy.html
@@ -53,7 +53,7 @@
</ul>
</div>
</div>
- </div><div id='content' class='page-1'><div class='row'><div class='row-fluid'><div class='col-lg-3'><ul class='nav-sidebar'><li><a href='./'>Blog index</a></li><li class='active'><a href='#doc'>Zipping Collections with Groovy</a></li><li><a href='#_what_is_zipping' class='anchor-link'>What is zipping?</a></li><li><a href='#_groovy' class='anchor-link'>Groovy</a></li><li><a href='#_eclipse_collections' class='anchor-link'>Eclipse Collections</a></li><li><a href='# [...]
+ </div><div id='content' class='page-1'><div class='row'><div class='row-fluid'><div class='col-lg-3'><ul class='nav-sidebar'><li><a href='./'>Blog index</a></li><li class='active'><a href='#doc'>Zipping Collections with Groovy</a></li><li><a href='#_what_is_zipping' class='anchor-link'>What is zipping?</a></li><li><a href='#_groovy' class='anchor-link'>Groovy</a></li><li><a href='#_eclipse_collections' class='anchor-link'>Eclipse Collections</a></li><li><a href='# [...]
<h2 id="_what_is_zipping">What is zipping?</h2>
<div class="sectionbody">
<div class="paragraph">