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 667f3f0  general tidy up
667f3f0 is described below

commit 667f3f0c6eb299793c3967efb1e139a4cace0613
Author: Paul King <[email protected]>
AuthorDate: Fri Feb 17 12:53:33 2023 +1000

    general tidy up
---
 .../blog/classifying-iris-flowers-with-deep.adoc   | 24 +++++++++++-----------
 .../blog/detecting-objects-with-groovy-the.adoc    | 24 ++++++++++++++--------
 .../encryption-and-decryption-with-groovy.adoc     |  8 ++++----
 3 files changed, 31 insertions(+), 25 deletions(-)

diff --git a/site/src/site/blog/classifying-iris-flowers-with-deep.adoc 
b/site/src/site/blog/classifying-iris-flowers-with-deep.adoc
index 51d05f5..6bcb5fe 100644
--- a/site/src/site/blog/classifying-iris-flowers-with-deep.adoc
+++ b/site/src/site/blog/classifying-iris-flowers-with-deep.adoc
@@ -84,9 +84,9 @@ println "Validation error: " + 
pretty(calculateRegressionError(bestMethod, model
 
 When we run the example, we see:
 
-[source,subs="quotes,macros"]
+[subs="quotes"]
 ----
-[lime]*paulk@pop-os*pass:v[:][blue]*/extra/projects/iris_encog*$ time groovy 
-cp "build/lib/*" IrisEncog.groovy
+[lime]#paulk@pop-os#:[blue]##/extra/projects/iris_encog##$ time groovy -cp 
"build/lib/*" IrisEncog.groovy
 1/5 : Fold #1
 1/5 : Fold #1/5: Iteration #1, Training Error: 1.43550735, Validation Error: 
0.73302237
 1/5 : Fold #1/5: Iteration #2, Training Error: 0.78845427, Validation Error: 
0.73302237
@@ -156,9 +156,9 @@ println eval.stats()
 
 When we run this example, we see:
 
-[source,subs="quotes,macros"]
+[subs="quotes"]
 ----
-[lime]*paulk@pop-os*pass:v[:][blue]*/extra/projects/iris_encog*$ time groovy 
-cp "build/lib/*" IrisDl4j.groovy
+[lime]#paulk@pop-os#:[blue]##/extra/projects/iris_encog##$ time groovy -cp 
"build/lib/*" IrisDl4j.groovy
 [main] INFO org.nd4j.linalg.factory.Nd4jBackend - Loaded [CpuBackend] backend
 [main] INFO org.nd4j.nativeblas.NativeOpsHolder - Number of threads used for 
linear algebra: 4
 [main] INFO org.nd4j.nativeblas.Nd4jBlas - Number of threads used for OpenMP 
BLAS: 4
@@ -250,9 +250,9 @@ new ClassifierEvaluator().with {
 
 When we run this command we see:
 
-[source,subs="quotes,macros"]
+[subs="quotes"]
 ----
-[lime]*paulk@pop-os*pass:v[:][blue]*/extra/projects/iris_encog*$ time groovy 
-cp "build/lib/*" Iris.groovy
+[lime]#paulk@pop-os#:[blue]##/extra/projects/iris_encog##$ time groovy -cp 
"build/lib/*" Iris.groovy
 16:49:27.089 [main] INFO deepnetts.core.DeepNetts - 
------------------------------------------------------------------------
 16:49:27.091 [main] INFO deepnetts.core.DeepNetts - TRAINING NEURAL NETWORK
 16:49:27.091 [main] INFO deepnetts.core.DeepNetts - 
------------------------------------------------------------------------
@@ -298,16 +298,16 @@ nature has a more limited set of metaprogramming 
capabilities but allows bytecod
 Java to be produced. Luckily, we aren't relying on any dynamic Groovy tricks 
for our example.
 We'll compile it up using static mode:
 
-[source,subs="quotes,macros"]
+[subs="quotes"]
 ----
-[lime]*paulk@pop-os*pass:v[:][blue]*/extra/projects/iris_encog*$ groovyc -cp 
"build/lib/*" --compile-static Iris.groovy
+[lime]#paulk@pop-os#:[blue]##/extra/projects/iris_encog##$ groovyc -cp 
"build/lib/*" --compile-static Iris.groovy
 ----
 
 Next we build our native application:
 
-[source,subs="quotes,macros"]
+[subs="quotes"]
 ----
-[lime]*paulk@pop-os*pass:v[:][blue]*/extra/projects/iris_encog*$ native-image  
--report-unsupported-elements-at-runtime \
+[lime]#paulk@pop-os#:[blue]##/extra/projects/iris_encog##$ native-image  
--report-unsupported-elements-at-runtime \
    
--initialize-at-run-time=groovy.grape.GrapeIvy,deepnetts.net.weights.RandomWeights
 \
    --initialize-at-build-time --no-fallback  
-H:ConfigurationFileDirectories=conf/  -cp ".:build/lib/*" Iris
 ----
@@ -318,9 +318,9 @@ We also did the same for the `RandomWeights` class to avoid 
it being locked into
 
 Now we are ready to run our application:
 
-[source,subs="quotes,macros"]
+[subs="quotes"]
 ----
-[lime]*paulk@pop-os*pass:v[:][blue]*/extra/projects/iris_encog*$ time ./iris
+[lime]#paulk@pop-os#:[blue]##/extra/projects/iris_encog##$ time ./iris
 ...
 CLASSIFIER EVALUATION METRICS
 Accuracy: 0.93460923 (How often is classifier correct in total)
diff --git a/site/src/site/blog/detecting-objects-with-groovy-the.adoc 
b/site/src/site/blog/detecting-objects-with-groovy-the.adoc
index 9ba2e68..8b8dda7 100644
--- a/site/src/site/blog/detecting-objects-with-groovy-the.adoc
+++ b/site/src/site/blog/detecting-objects-with-groovy-the.adoc
@@ -119,18 +119,20 @@ dependencies {
 
 We run the application with the gradle `run` task:
 
-```sh
-paulk@pop-os:/extra/projects/groovy-data-science$ ./gradlew DLMXNet:run
+[subs="quotes"]
+----
+[lime]#paulk@pop-os#:[blue]##/extra/projects/groovy-data-science##$ ./gradlew 
DLMXNet:run
 > Task :DeepLearningMxnet:run
-Downloading: 100% |████████████████████████████████████████| dog-ssd.jpg
-Loading:     100% |████████████████████████████████████████|
+Downloading: 100% |[olive]#████████████████████████████████████████#| 
dog-ssd.jpg
+Loading:     100% |[olive]#████████████████████████████████████████#|
 ...
-class: "car", probability: 0.99991, bounds: [x=0.611, y=0.137, width=0.293, 
height=0.160]
-class: "bicycle", probability: 0.95385, bounds: [x=0.162, y=0.207, 
width=0.594, height=0.588]
-class: "dog", probability: 0.93752, bounds: [x=0.168, y=0.350, width=0.274, 
height=0.593]
-```
+class: [green]*"car"*, probability: *0.99991*, bounds: [x=0.611, y=0.137, 
width=0.293, height=0.160]
+class: [green]*"bicycle"*, probability: *0.95385*, bounds: [x=0.162, y=0.207, 
width=0.594, height=0.588]
+class: [green]*"dog"*, probability: *0.93752*, bounds: [x=0.168, y=0.350, 
width=0.274, height=0.593]
+----
 
 The displayed image looks like this:
+
 image:img/detected_objects.png[Detected objects,468]
 
 == Further Information
@@ -140,4 +142,8 @@ 
https://github.com/paulk-asert/groovy-data-science/subprojects/DeepLearningMxnet
 
 == Conclusion
 
-We have examined using Apache Groovy, DLJ and Apache MXNet to detect objects 
within an image. We've used a model based on a rich deep learning model, but we 
didn't need to get into the details of the model or its neural network layers. 
DLJ and Apache MXNet did the hard lifting for us. Groovy provided a simple 
coding experience for building our application.
+We have examined using Apache Groovy, DLJ and Apache MXNet to detect objects
+within an image. We've used a model based on a rich deep learning model, but we
+didn't need to get into the details of the model or its neural network layers.
+DLJ and Apache MXNet did the hard lifting for us. Groovy provided a simple 
coding
+experience for building our application.
diff --git a/site/src/site/blog/encryption-and-decryption-with-groovy.adoc 
b/site/src/site/blog/encryption-and-decryption-with-groovy.adoc
index 65f1de6..3b2be1e 100644
--- a/site/src/site/blog/encryption-and-decryption-with-groovy.adoc
+++ b/site/src/site/blog/encryption-and-decryption-with-groovy.adoc
@@ -13,8 +13,8 @@ First, we need some text to encrypt. We'll use an excerpt of 
the one from the af
 
 [source,groovy]
 ----
-var text = 'Contrary to popular belief, Lorem Ipsum is not simply random text.\
- It has roots in a piece of classical Latin literature from 45 BC, making it 
over 2000 years old.'
+var text = 'Contrary to popular belief, Lorem Ipsum is not simply random text. 
It has \
+roots in a piece of classical Latin literature from 45 BC, making it over 2000 
years old.'
 ----
 
 Next, we'll create a factory for our cipher instance, generate a key, and set 
up an initialization vector.
@@ -102,7 +102,7 @@ Which has this output:
 [source]
 ----
 Encrypted bytes : [-117, 36, 18, 69, -101, -8, 35, 93, -102, -49, -12, …, -19, 
-100]
-Encrypted text : 
‹$E›ø#]šÏôæ”Á˜çp^µ³=L(Ö^_ŒC&gt;CIË„ö,1É8ÆŸ.Š?vßG,Èw‰å¼zÜf&gt;?µ›D¹éÆk€ 
°˜2êÔ}í©àhl$&gt;?¹¡Kå3ÔO?±&amp;…êî¶Ê–¾°®q®à—0ú‘ÔhO&lt;H¦ç®Ç”ÈhAëjó 
QPyƒy6Ĥ*´un¼ï¯m¨´ÙjeJtëº\ó6ƪKªœíœ
+Encrypted text : 
‹$E›ø#]šÏôæ”Á˜çp^µ³=L(Ö^_ŒC>CIË„ö,1É8ÆŸ.Š?vßG,Èw‰å¼zÜf>?µ›D¹éÆk€ 
°˜2êÔ}í©àhl$>?¹¡Kå3ÔO?±&…êî¶Ê–¾°®q®à—0ú‘ÔhO<H¦ç®Ç”ÈhAëjó 
QPyƒy6Ĥ*´un¼ï¯m¨´ÙjeJtëº\ó6ƪKªœíœ
 Decrypted bytes : [67, 111, 110, 116, 114, 97, 114, 121, 32, 116, 111, 32, …, 
100, 46]
 Decrypted text : Contrary to popular belief, Lorem Ipsum is not simply random 
text. It has roots in a piece of classical Latin literature from 45 BC, making 
it over 2000 years old.
 ----
@@ -148,7 +148,7 @@ Which has this output:
 
 [source]
 ----
-Encrypted text : Mªá?r?v9£÷~4µT'›ÙÝÁl¿Þg¾0ñŽ¡?Ü=³9Q¬»3«ÖÁ¡µ 
¾@4÷`FñÙŠfø7¥#›v¤Í–‰¼Ü¢ƒE6ôŽTÙlæÏz&gt;o?àL›¡¢z1nÖo9]šOÔ¼SÔOÍ#Ý7LœÀî}ó5m%q•»l%
/AWT´¢zH#t솱l¶£—Œ«©wˆÃ®&gt;®Ü6ër-E
+Encrypted text : Mªá?r?v9£÷~4µT'›ÙÝÁl¿Þg¾0ñŽ¡?Ü=³9Q¬»3«ÖÁ¡µ 
¾@4÷`FñÙŠfø7¥#›v¤Í–‰¼Ü¢ƒE6ôŽTÙlæÏz>o?àL›¡¢z1nÖo9]šOÔ¼SÔOÍ#Ý7LœÀî}ó5m%q•»l%
/AWT´¢zH#t솱l¶£—Œ«©wˆÃ®>®Ü6ër-E
 Decrypted text : Contrary to popular belief, Lorem Ipsum is not simply random 
text. It has roots in a piece of classical Latin literature from 45 BC, making 
it over 2000 years old.
 ----
 

Reply via email to