This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/groovy-website.git


The following commit(s) were added to refs/heads/asf-site by this push:
     new 3504952  general tidy up
3504952 is described below

commit 35049523ed9e18c8e4df039b0d0a1f43949b856e
Author: Paul King <[email protected]>
AuthorDate: Fri Feb 17 13:48:35 2023 +1000

    general tidy up
---
 site/src/site/blog/fruity-eclipse-collections.adoc |  9 ++-
 site/src/site/blog/life-on-mars-units-of.adoc      | 24 ++++---
 .../matrix-calculations-with-groovy-apache.adoc    | 73 ++++++++++++----------
 3 files changed, 63 insertions(+), 43 deletions(-)

diff --git a/site/src/site/blog/fruity-eclipse-collections.adoc 
b/site/src/site/blog/fruity-eclipse-collections.adoc
index 2d04ad3..38598ed 100644
--- a/site/src/site/blog/fruity-eclipse-collections.adoc
+++ b/site/src/site/blog/fruity-eclipse-collections.adoc
@@ -91,15 +91,17 @@ For some fun, let's look at whether the nominated color of 
each fruit matches th
 of the related emoji. As in the previous blog, we'll use the slightly nicer
 
https://fonts.google.com/noto/specimen/Noto+Color+Emoji?preview.text=%F0%9F%8D%8E%F0%9F%8D%91%F0%9F%8D%8C%F0%9F%8D%92%F0%9F%8D%8A%F0%9F%8D%87&amp;preview.text_type=custom[Noto
 Color Emoji]
 fonts for our fruit as shown here:
+
 image:img/fruit_emoji.png[Noto Color Emoji]
+
 We'll use an Eclipse Collection `BiMap` to switch back and forth between the 
color names
 and java.awt colors:
 
 [source,groovy]
 ----
 @Field public static COLOR_OF = BiMaps.immutable.ofAll([
-WHITE: WHITE, RED: RED, GREEN: GREEN, BLUE: BLUE,
-ORANGE: ORANGE, YELLOW: YELLOW, MAGENTA: MAGENTA
+    WHITE: WHITE, RED: RED, GREEN: GREEN, BLUE: BLUE,
+    ORANGE: ORANGE, YELLOW: YELLOW, MAGENTA: MAGENTA
 ])
 @Field public static NAME_OF = COLOR_OF.inverse()
 ----
@@ -125,8 +127,9 @@ static rgb(BufferedImage image, int x, int y) {
 
 The HSB color space represents colors in a spectrum from 0 to 360 degrees:
 
+.Image credit: ++https://nycdoe-cs4all.github.io/units/1/lessons/lesson_3.2++
 
image:https://nycdoe-cs4all.github.io/images/lessons/unit_1/3.2/circle.png[Color
 Circle]
-Image credit: https://nycdoe-cs4all.github.io/units/1/lessons/lesson_3.2
+
 
 We have two helper methods to assist with colors.
 The first picks out "_mostly black_" and "_mostly white_" colors while
diff --git a/site/src/site/blog/life-on-mars-units-of.adoc 
b/site/src/site/blog/life-on-mars-units-of.adoc
index a7322b6..6449d1e 100644
--- a/site/src/site/blog/life-on-mars-units-of.adoc
+++ b/site/src/site/blog/life-on-mars-units-of.adoc
@@ -16,6 +16,8 @@ 
image:https://upload.wikimedia.org/wikipedia/commons/thumb/1/19/Mars_Climate_Orb
 If the system in question had been developed using a units of
 measurement system, perhaps the failure could have been avoided.
 
+== Units of measurement systems
+
 All programming languages have types for representing numbers.
 As an example, we may have three integers, one representing a
 height, one a weight and one a temperature. We can write code
@@ -50,6 +52,8 @@ status. The JSR 385 maintenance release was approved last 
year and
 the latest version of the reference implementation was released
 earlier this year.
 
+== JSR 385: Units of Measurement API 2.0
+
 The first thing we need to do is bring in our dependencies (shown for 
https://gradle.org/[Gradle] - 
https://mvnrepository.com/artifact/tech.units/indriya/2.1.3[other options]).
 The main one is the reference implementation (it brings in the
 `javax.measure` API transitively):
@@ -103,8 +107,9 @@ println massₘ > diameterₘ
 
 We'll see a runtime error like this:
 
+[subs="quotes"]
 ----
-javax.measure.IncommensurableException: km is not compatible with kg
+[maroon]#javax.measure.IncommensurableException: km is not compatible with kg#
 ----
 
 Or, with `TypeChecked` or `CompileStatic` in play for a statement like this:
@@ -117,9 +122,10 @@ println massₘ.add(diameterₘ)
 
 We'd see a compile-time error like this:
 
+[subs="quotes"]
 ----
-[Static type checking] - Cannot call 
tech.units.indriya.ComparableQuantity#add(javax.measure.Quantity<javax.measure.quantity.Mass>)
-with arguments 
[tech.units.indriya.ComparableQuantity<javax.measure.quantity.Length>]
+[maroon]##[Static type checking] - Cannot call 
tech.units.indriya.ComparableQuantity#add(javax.measure.Quantity<javax.measure.quantity.Mass>)
+with arguments 
[tech.units.indriya.ComparableQuantity<javax.measure.quantity.Length>]##
 ----
 
 If for some strange reason we did want to compare or perform
@@ -178,6 +184,8 @@ Which shows us that the diameter of Mars is a little over 
4200 miles:
 4212.275312176886980036586335798934 (m*1609344)/1000
 ----
 
+== Adding some metaprogramming
+
 Groovy has various features which allow methods to be (apparently)
 added to classes. We'll use extension methods. This technique
 involves writing static methods in a helper class using certain
@@ -380,8 +388,9 @@ move forward by 2.kgs
 
 We'll now see a compile-time error:
 
+[subs="quotes"]
 ----
-[Static type checking] - Cannot call 
MoveHolder#by(javax.measure.Quantity<javax.measure.quantity.Length>) with 
arguments [javax.measure.Quantity<javax.measure.quantity.Mass>]
+[maroon]##[Static type checking] - Cannot call 
MoveHolder#by(javax.measure.Quantity<javax.measure.quantity.Length>) with 
arguments [javax.measure.Quantity<javax.measure.quantity.Mass>]##
 ----
 
 It is great to get this additional earlier feedback on script
@@ -434,9 +443,9 @@ afterMethodCall { call ->
 }
 ----
 
-This is only a partial implementation, it's make numerous
+This is only a partial implementation, it makes numerous
 assumptions. We could remove those assumptions by adding
-more code but for now we'll keep this simplified version.
+more code, but for now we'll keep this simplified version.
 
 So, now the following script (with the above type checking extension applied) 
compiles fine:
 
@@ -454,8 +463,9 @@ move right by 2.m at 6.cm/s
 
 The error message is:
 
+[subs="quotes"]
 ----
-[Static type checking] - Speed of 6 is too fast!
+[maroon]##[Static type checking] - Speed of 6 is too fast!##
 ----
 
 == Further information
diff --git a/site/src/site/blog/matrix-calculations-with-groovy-apache.adoc 
b/site/src/site/blog/matrix-calculations-with-groovy-apache.adoc
index a3b219b..5d02739 100644
--- a/site/src/site/blog/matrix-calculations-with-groovy-apache.adoc
+++ b/site/src/site/blog/matrix-calculations-with-groovy-apache.adoc
@@ -37,7 +37,7 @@ be in one year? The sequence goes like this:
 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233
 ----
 
-We can solve this problem using matrices. If we multiply the matrix 
image:img/FibMatrix.png[fibonacci matrix] by itself n times we get 
image:img/FibMatrixN.png[fib n matrix].
+We can solve this problem using matrices. If we multiply the matrix 
image:img/FibMatrix.png[fibonacci matrix,43] by itself n times we get 
image:img/FibMatrixN.png[fib n matrix,82].
 This is an operation known as matrix exponentiation.
 Let's explore this problem using four of the most popular
 and maintained matrix libraries.
@@ -150,13 +150,14 @@ numerous other numerical and related types).
 
 Running the script gives the following output:
 
+[subs="quotes"]
 ----
-...
+[maroon]##...
 [main] INFO org.nd4j.linalg.factory.Nd4jBackend - Loaded [CpuBackend] backend
 ...
 [main] INFO org.nd4j.linalg.cpu.nativecpu.CpuNDArrayFactory - Binary level 
Generic x86 optimization level AVX/AVX2
 [main] INFO org.nd4j.linalg.api.ops.executioner.DefaultOpExecutioner - Blas 
vendor: [OPENBLAS]
-...
+...##
 [[         3,         2],
  [         2,         1]]
 [[       233,       144],
@@ -286,8 +287,9 @@ This example was run on JDK16 with the following VM options:
 
 The output looks like this:
 
+[subs="quotes"]
 ----
-WARNING: Using incubator modules: jdk.incubator.vector
+[maroon]##WARNING: Using incubator modules: jdk.incubator.vector##
 Simple: 116.34 ms
 Optimized: 34.91 ms
 Vector: 21.94 ms
@@ -618,39 +620,43 @@ We saw earlier that some of the examples could make use 
of Groovy
 operator shorthand syntax, while others couldn't. Here is a
 summary of some common methods in the libraries:
 
-
+[subs="quotes,macros",cols=5]
 |===
-|Groovy operator | + | - | * | **
-
-|Groovy method
-|plus
-|minus
-|multiply
-|power
-
-|Commons math
-|add
-|subtract
-|multiply
-|power
-
-|EJML
-|plus
-|minus
-|mult
+| [blue]*_Groovy operator&nbsp;_*
+| [blue]*_+_*
+| [blue]*_-_*
+| [blue]**_pass:v[*]_**
+| [blue]**_pass:v[**]_**
+
+| [blue]*_Groovy method_*
+| [blue]*_plus_*
+| [blue]*_minus_*
+| [blue]*_multiply_*
+| [blue]*_power_*
+
+|[aqua]*_Commons math_*
+|`add`
+|`subtract`
+|`multiply`
+|`power`
+
+|[aqua]*_EJML_*
+|`plus`
+|`minus`
+|`mult`
 |-
 
-|Nd4j
-|add
-|sub
-|mmul
+|[aqua]*_Nd4j_*
+|`add`
+|`sub`
+|`mmul`
 |-
 
-|ojAlgo
-|add
-|subtract
-|multiply
-|power
+|[aqua]*_ojAlgo_*
+|`add`
+|`subtract`
+|`multiply`
+|`power`
 |===
 
 Where the library used the same name as Groovy's method,
@@ -703,9 +709,10 @@ jlatexmath library. So instead of seeing
 `Array2DRowRealMatrix{{13.0,8.0},{8.0,5.0}}`, they will see
 a graphical rendition of the matrix. So, the final end-user
 experience when using the GroovyConsole looks like this:
+
 image:img/GroovyConsoleOutputTransformsMatrix.png[matrix output transforms in 
groovy console]
 
-When using in Jupyter style environments, other pretty outpu
+When using in Jupyter style environments, other pretty output
 styles may be supported.
 
 == Further information

Reply via email to