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 c80ee01 2023/02/17 05:13:52: Generated dev website from
groovy-website@54089a0
c80ee01 is described below
commit c80ee01b2467ea404d742d12297604b2934b4951
Author: jenkins <[email protected]>
AuthorDate: Fri Feb 17 05:13:52 2023 +0000
2023/02/17 05:13:52: Generated dev website from groovy-website@54089a0
---
blog/parsing-json-with-groovy.html | 18 ++++----
...olving-cryptarithmetic-puzzles-with-groovy.html | 24 ++++++++++-
blog/testing-your-java-with-groovy.html | 9 ++--
blog/working-with-sql-databases-with.html | 48 +++++++++++-----------
4 files changed, 61 insertions(+), 38 deletions(-)
diff --git a/blog/parsing-json-with-groovy.html
b/blog/parsing-json-with-groovy.html
index 72941e4..17e5da5 100644
--- a/blog/parsing-json-with-groovy.html
+++ b/blog/parsing-json-with-groovy.html
@@ -312,12 +312,11 @@ surefire plugin will use that by default and not find our
test.</p>
</div>
<div class="listingblock">
<div class="content">
-<pre>[INFO] -------------------------------------------------------
-[INFO] T E S T S
-[INFO] -------------------------------------------------------
-[INFO] Running JsonTest
-[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.36 s
- in JsonTest
-Advanced features</pre>
+<pre>[<span class="blue">INFO</span>]
------------------------------------------------------
+[<span class="blue">INFO</span>] T E S T S
+[<span class="blue">INFO</span>]
------------------------------------------------------
+[<span class="blue">INFO</span>] Running JsonTest
+[<span class="blue">INFO</span>] Tests run: 1, Failures: 0, Errors: 0,
Skipped: 0, Time elapsed: 0.36 s - in JsonTest</pre>
</div>
</div>
</div>
@@ -430,7 +429,7 @@ prices (per 100g) and the concentration of vitamin C (per
100g):</p>
</div>
<div class="listingblock">
<div class="content">
-<pre class="prettyprint highlight"><code data-lang="groovy">{
+<pre class="prettyprint highlight"><code data-lang="json">{
"prices": [
{"name": "Kakuda plum", "price": 13},
{"name": "Camu camu", "price": 25},
@@ -461,13 +460,13 @@ when we go shopping. Our GQuery processing looks like
this:</p>
<div class="content">
<pre class="prettyprint highlight"><code data-lang="groovy">def jsonFile = new
File('fruit.json')
def json = new JsonSlurper().parse(jsonFile)
-assert GQ {
+assert GQL {
from p in json.prices
join c in json.vitC on c.name == p.name
orderby c.conc / p.price in desc
limit 2
select p.name
-}.toList() == ['Kakuda plum', 'Kiwifruit']</code></pre>
+} == ['Kakuda plum', 'Kiwifruit']</code></pre>
</div>
</div>
<div class="paragraph">
@@ -498,6 +497,7 @@ was made using GraalVM. It’s timings are included
too.</p>
real 0m1.365s
user 0m4.157s
sys 0m0.145s
+
$ time groovy GroovyJsonCharacterSource.groovy
real 0m1.447s
user 0m4.472s
diff --git a/blog/solving-cryptarithmetic-puzzles-with-groovy.html
b/blog/solving-cryptarithmetic-puzzles-with-groovy.html
index 6311162..2e76287 100644
--- a/blog/solving-cryptarithmetic-puzzles-with-groovy.html
+++ b/blog/solving-cryptarithmetic-puzzles-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'>Solving cryptarithmetic puzzles with Groovy and constraint
programming using Choco, JaCoP, and OR-Tools</a></li><li><a
href='#_introduction' class='anchor-link'>Introduction</a></li><li><a
href='#_cryptarithmetic_problems' class='anchor-link'>Cryptarithmetic
Problems</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'>Solving cryptarithmetic puzzles with Groovy and constraint
programming using Choco, JaCoP, and OR-Tools</a></li><li><a
href='#_introduction' class='anchor-link'>Introduction</a></li><li><a
href='#_cryptarithmetic_problems' class='anchor-link'>Cryptarithmetic
Problems</a></ [...]
<h2 id="_introduction">Introduction</h2>
<div class="sectionbody">
<div class="paragraph">
@@ -268,6 +268,22 @@ m = 1, o = 0, r = 8, y = 2</pre>
</div>
</div>
<div class="sect1">
+<h2 id="_using_constraint_programming">Using Constraint Programming</h2>
+<div class="sectionbody">
+<div class="paragraph">
+<p>For the brute force approaches, we had a condition which checked any
+potential candidate answer to see if it was a correct solution. We had
+to be very explicit in how we wanted the potential candidates to be
+created. For constraint programming, we instead define variables to
+represent the problem, any known bounds on those variables, and we
+specify any other known properties of the solution, which in our case
+will be something similar to the condition we had to check if the
+answer was correct previously. Let’s examine how to do that with
+three libraries, one with a variation.</p>
+</div>
+</div>
+</div>
+<div class="sect1">
<h2 id="_choco">Choco</h2>
<div class="sectionbody">
<div class="paragraph">
@@ -500,6 +516,8 @@ programming libraries seem to be using the direct library
classes.
Indeed, the version of the Choco implementation used by the JSR331
implementation is over 10 years old.</p>
</div>
+<div class="sect2">
+<h3 id="_incorporating_carry">Incorporating Carry</h3>
<div class="paragraph">
<p>The scalar product global constraint we have used in the previous
examples is very powerful and probably would be our first choice
@@ -561,6 +579,9 @@ They don’t form part of the answer that interests us,
so we would
be free to just print out the part of the solution which interests
us if we wanted.</p>
</div>
+</div>
+<div class="sect2">
+<h3 id="_creating_a_dsl">Creating a DSL</h3>
<div class="paragraph">
<p>The previous example has lots of calls to <code>add</code> and
<code>mul</code> methods.
We can create a little bit of a DSL to provide some syntactic
@@ -660,6 +681,7 @@ that no solution is possible.</p>
</div>
</div>
</div>
+</div>
<div class="sect1">
<h2 id="_looking_at_other_languages">Looking at other languages</h2>
<div class="sectionbody">
diff --git a/blog/testing-your-java-with-groovy.html
b/blog/testing-your-java-with-groovy.html
index de53dd6..5e46fd3 100644
--- a/blog/testing-your-java-with-groovy.html
+++ b/blog/testing-your-java-with-groovy.html
@@ -56,7 +56,8 @@
</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'>Testing your Java with Groovy, Spock, JUnit5, Jacoco, Jqwik and
Pitest</a></li><li><a href='#_the_system_under_test' class='anchor-link'>The
system under test</a></li><li><a href='#_testing_with_spock'
class='anchor-link'>Testing with Spock</a></li><li><a href='#_mutation_ [...]
<div class="sectionbody">
<div class="paragraph">
-<p>This blog post covers a common scenario seen in the Groovy community which
is
+<p><span class="image right"><img src="img/spock_logo.png" alt="spock logo"
width="100"></span>
+This blog post covers a common scenario seen in the Groovy community which is
projects which use Java for their production code and Groovy for their tests.
This can be a low risk way for Java shops to try out and become more familiar
with Groovy. We’ll write our initial tests using the
@@ -137,7 +138,7 @@ hasn’t covered all lines of code:</p>
where:
a | b | c | d
2 | 5 | 3 | 8
- 5 | 2 | 3 | 8
+ <strong>5 | 2 | 3 | 8</strong>
}</code></pre>
</div>
</div>
@@ -161,7 +162,7 @@ Let’s add one more testcase:</p>
a | b | c | d
2 | 5 | 3 | 8
5 | 2 | 3 | 8
- 5 | 4 | 1 | 9
+ <strong>5 | 4 | 1 | 9</strong>
}</code></pre>
</div>
</div>
@@ -186,7 +187,7 @@ Before we do, we’ll add one more testcase:</p>
2 | 5 | 3 | 8
5 | 2 | 3 | 8
5 | 4 | 1 | 9
- 3 | 2 | 6 | 9
+ <strong>3 | 2 | 6 | 9</strong>
}</code></pre>
</div>
</div>
diff --git a/blog/working-with-sql-databases-with.html
b/blog/working-with-sql-databases-with.html
index 7843029..2fe2903 100644
--- a/blog/working-with-sql-databases-with.html
+++ b/blog/working-with-sql-databases-with.html
@@ -211,39 +211,39 @@ the native app for us:</p>
</div>
<div class="listingblock">
<div class="content">
-<pre class="prettyprint highlight"><code
data-lang="shell">paulk@pop-os:/extra/projects/groovy-graalvm-h2$ ./gradlew
clean nativeRun
+<pre><span class="lime">paulk@pop-os</span>:<span
class="blue">/extra/projects/groovy-graalvm-h2</span>$ ./gradlew clean nativeRun
...
-> Task :nativeCompile
+> Task :nativeCompile
[native-image-plugin] Using executable path:
/extra/devtools/graalvm-ce-java17-22.2.0/bin/native-image
-====================================================================================================
+==========================================================================================
GraalVM Native Image: Generating 'H2Demo' (executable)...
-====================================================================================================
+==========================================================================================
...
-[1/7] Initializing...
(5.3s @ 0.26GB)
+<span class="blue">[1/7] Initializing...</span>
(5.3s @ 0.26GB)
Version info: 'GraalVM 22.2.0 Java 17 CE'
Java version info: '17.0.4+8-jvmci-22.2-b06'
C compiler: gcc (linux, x86_64, 11.2.0)
Garbage collector: Serial GC
1 user-specific feature(s)
- com.oracle.svm.polyglot.groovy.GroovyIndyInterfaceFeature
-[2/7] Performing analysis... [************]
(51.7s @ 1.82GB)
+<span class="blue">[2/7] Performing analysis...</span> [************]
(51.7s @ 1.82GB)
10,597 (90.60%) of 11,697 classes reachable
17,002 (64.13%) of 26,510 fields reachable
58,165 (63.45%) of 91,666 methods reachable
393 classes, 100 fields, and 2,057 methods registered for reflection
65 classes, 74 fields, and 55 methods registered for JNI access
4 native libraries: dl, pthread, rt, z
-[3/7] Building universe...
(8.0s @ 4.02GB)
-[4/7] Parsing methods... [**]
(4.8s @ 3.85GB)
-[5/7] Inlining methods... [***]
(3.0s @ 1.72GB)
-[6/7] Compiling methods... [******]
(38.0s @ 3.63GB)
-[7/7] Creating image...
(5.9s @ 1.70GB)
+<span class="blue">[3/7] Building universe...</span>
(8.0s @ 4.02GB)
+<span class="blue">[4/7] Parsing methods...</span> [**]
(4.8s @ 3.85GB)
+<span class="blue">[5/7] Inlining methods...</span> [***]
(3.0s @ 1.72GB)
+<span class="blue">[6/7] Compiling methods...</span> [******]
(38.0s @ 3.63GB)
+<span class="blue">[7/7] Creating image...</span>
(5.9s @ 1.70GB)
26.65MB (46.64%) for code area: 38,890 compilation units
28.04MB (49.05%) for image heap: 359,812 objects and 66 resources
2.46MB ( 4.31%) for other data
57.15MB in total
-----------------------------------------------------------------------------------------------------
-Top 10 packages in code area: Top 10 object
types in image heap:
+------------------------------------------------------------------------------------------
+<span class="gold">Top 10 packages in code area:
Top 10 object types in image heap:</span>
1.48MB sun.security.ssl 5.85MB byte[]
for code metadata
1.06MB java.util 2.82MB
java.lang.String
979.43KB java.lang.invoke 2.78MB
java.lang.Class
@@ -255,21 +255,21 @@ Top 10 packages in code area:
Top 10 object types
476.03KB c.s.org.apache.xerces.internal.impl.xs.traversers 715.65KB byte[]
for embedded resources
468.69KB java.lang 584.75KB
java.util.HashMap$Node[]
18.87MB for 370 more packages 8.28MB for 2535
more object types
-----------------------------------------------------------------------------------------------------
+------------------------------------------------------------------------------------------
3.9s (3.2% of total time) in 30 GCs | Peak RSS: 6.22GB
| CPU load: 6.48
-----------------------------------------------------------------------------------------------------
-Produced artifacts:
+------------------------------------------------------------------------------------------
+<span class="gold">Produced artifacts:</span>
/extra/projects/groovy-graalvm-h2/build/native/nativeCompile/H2Demo
(executable)
/extra/projects/groovy-graalvm-h2/build/native/nativeCompile/H2Demo.build_artifacts.txt
(txt)
-=====================================================================================================
+===========================================================================================
Finished generating 'H2Demo' in 2m 1s.
[native-image-plugin] Native Image written to:
/extra/projects/groovy-graalvm-h2/build/native/nativeCompile
-> Task :nativeRun
-[ID:1, NAME:Lord Archimonde]
+> Task :nativeRun
+<span class="aqua">[ID:1, NAME:Lord Archimonde]
[ID:2, NAME:Arthur]
[ID:3, NAME:Gilbert]
-[ID:4, NAME:Grug]</code></pre>
+[ID:4, NAME:Grug]</span></pre>
</div>
</div>
</div>
@@ -282,15 +282,15 @@ Finished generating 'H2Demo' in 2m 1s.
</div>
<div class="listingblock">
<div class="content">
-<pre class="prettyprint highlight"><code
data-lang="shell">paulk@pop-os:/extra/projects/groovy-graalvm-h2$ time
build/native/nativeCompile/H2Demo
-[ID:1, NAME:Lord Archimonde]
+<pre><span class="lime">paulk@pop-os</span>:<span
class="blue">/extra/projects/groovy-graalvm-h2</span>$ time
build/native/nativeCompile/H2Demo
+<span class="aqua">[ID:1, NAME:Lord Archimonde]
[ID:2, NAME:Arthur]
[ID:3, NAME:Gilbert]
-[ID:4, NAME:Grug]
+[ID:4, NAME:Grug]</span>
real 0m0.027s
user 0m0.010s
-sys 0m0.011s</code></pre>
+sys 0m0.011s</pre>
</div>
</div>
</div>