From 5d374d0351c4b28757180168cb40f85197e0f440 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 9 Apr 2023 21:48:52 +0300 Subject: Update content for gemtext --- gemfeed/2023-04-09-algorithms-in-golang-part-1.gmi | 229 ++++++++++ .../2023-04-09-algorithms-in-golang-part-1.gmi.tpl | 229 ++++++++++ gemfeed/atom.xml | 467 ++++++++++++--------- gemfeed/index.gmi | 1 + index.gmi | 3 +- uptime-stats.gmi | 2 +- 6 files changed, 732 insertions(+), 199 deletions(-) create mode 100644 gemfeed/2023-04-09-algorithms-in-golang-part-1.gmi create mode 100644 gemfeed/2023-04-09-algorithms-in-golang-part-1.gmi.tpl diff --git a/gemfeed/2023-04-09-algorithms-in-golang-part-1.gmi b/gemfeed/2023-04-09-algorithms-in-golang-part-1.gmi new file mode 100644 index 00000000..2ac5faa8 --- /dev/null +++ b/gemfeed/2023-04-09-algorithms-in-golang-part-1.gmi @@ -0,0 +1,229 @@ +# Algorithms in Go - Part 1 + +> Published at 2023-04-09T21:48:36+03:00 + +``` + ,_---~~~~~----._ + _,,_,*^____ _____``*g*\"*, + / __/ /' ^. / \ ^@q f +[ @f | @)) | | @)) l 0 _/ + \`/ \~____ / __ \_____/ \ + | _l__l_ I + } [______] I + ] | | | | + ] ~ ~ | + | | + | | +``` + +This is the first blog post about my Algorithms in Go series. I am not a Software Developer in my day job. In my current role, programming and scripting skills are desirable but not mandatory. I have been learning about Data Structures and Algorithms many years ago at University. I thought it would be fun to revisit/refresh my knowledge here and implement many of the algorithms in Go. + +=> ./2023-04-09-algorithms-in-golang-part-1.gmi 2023-04-09 Algorithms in Go - Part 1 (You are currently reading this) + +This post is about setting up some basic data structures and methods for this blog series. I promise, everything will be easy to follow in this post. + +## Type constraints + +First, the package `ds` (data structures) defines the `types.go`. All examples will either operate on the `Integer` or `Number` type: + +```go +package ds + +import ( + "golang.org/x/exp/constraints" +) + +type Integer interface { + constraints.Integer +} + +type Number interface { + constraints.Integer | constraints.Float +} + +``` + +## ArrayList + +Next comes the `arraylist.go`, which defines the underlying data structure all the algorithms of this series will use. `ArrayList` is just a type alias of a Go array (or slice) with custom methods on it: + +```go +package ds + +import ( + "fmt" + "math/rand" + "strings" +) + +type ArrayList[V Number] []V + +func NewArrayList[V Number](l int) ArrayList[V] { + return make(ArrayList[V], l) +} +``` + +As you can see, the code uses Go generics, which I refactored recently. Besides the default constructor (which only returns an empty `ArrayList` with a given capacity), there are also a bunch of special constructors. `NewRandomArrayList` is returning an `ArrayList` with random numbers, `NewAscendingArrayList` and `NewDescendingArrayList` are returning `ArrayList`s in either ascending or descending order. They all will be used later on for testing and benchmarking the algorithms. + +```go +func NewRandomArrayList[V Number](l, max int) ArrayList[V] { + a := make(ArrayList[V], l) + for i := 0; i < l; i++ { + if max > 0 { + a[i] = V(rand.Intn(max)) + continue + } + a[i] = V(rand.Int()) + } + return a +} + +func NewAscendingArrayList[V Number](l int) ArrayList[V] { + a := make(ArrayList[V], l) + for i := 0; i < l; i++ { + a[i] = V(i) + } + return a +} + +func NewDescendingArrayList[V Number](l int) ArrayList[V] { + a := make(ArrayList[V], l) + j := l - 1 + for i := 0; i < l; i++ { + a[i] = V(j) + j-- + } + return a +} +``` + +## Helper methods + +The `FirstN` method only returns the first N elements of the `ArrayList`. This is useful for printing out only parts of the data structure: + +```go +func (a ArrayList[V]) FirstN(n int) string { + var sb strings.Builder + j := n + + l := len(a) + if j > l { + j = l + } + + for i := 0; i < j; i++ { + fmt.Fprintf(&sb, "%v ", a[i]) + } + + if j < l { + fmt.Fprintf(&sb, "... ") + } + + return sb.String() +} +``` + +The `Sorted` method checks whether the `ArrayList` is sorted. This will be used by the unit tests later on: + +```go +func (a ArrayList[V]) Sorted() bool { + for i := len(a) - 1; i > 0; i-- { + if a[i] < a[i-1] { + return false + } + } + return true +} +``` + +And the last utility method used is `Swap`, which allows swapping the values of two indices in the `ArrayList`: + +```go +func (a ArrayList[V]) Swap(i, j int) { + aux := a[i] + a[i] = a[j] + a[j] = aux +} + +``` + +## Sleep sort + +Let's implement our first algorithm, sleep sort. Sleep sort is a non-traditional and unconventional sorting algorithm based on the idea of waiting a certain amount of time corresponding to the value of each element in the input `ArrayList`. It's more of a fun, creative concept rather than an efficient or practical sorting technique. This is not a sorting algorithm you would use in any production code. As you can imagine, it is quite an inefficient sorting algorithm (it's only listed here as a warm-up exercise). This sorting method may also return false results depending on how the Goroutines are scheduled by the Go runtime. + + +```go +package sort + +import ( + "codeberg.org/snonux/algorithms/ds" + "sync" + "time" +) + +func Sleep[V ds.Integer](a ds.ArrayList[V]) ds.ArrayList[V] { + sorted := ds.NewArrayList[V](len(a)) + + numCh := make(chan V) + var wg sync.WaitGroup + wg.Add(len(a)) + + go func() { + wg.Wait() + close(numCh) + }() + + for _, num := range a { + go func(num V) { + defer wg.Done() + time.Sleep(time.Duration(num) * time.Second) + numCh <- num + }(num) + } + + for num := range numCh { + sorted = append(sorted, num) + } + + return sorted +} +``` + +### Testing + +For testing, we only allow values up to 10, as otherwise, it would take too long to finish: + +```go +package sort + +import ( + "fmt" + "testing" + + "codeberg.org/snonux/algorithms/ds" +) + +func TestSleepSort(t *testing.T) { + a := ds.NewRandomArrayList[int](10, 10) + a = Sleep(a) + if !a.Sorted() { + t.Errorf("Array not sorted: %v", a) + } +} +``` + +As you can see, it takes `9s` here for the algorithm to finish (which is the highest value in the `ArrayList`): + +```sh +❯ go test ./sort -v -run SleepSort +=== RUN TestSleepSort +--- PASS: TestSleepSort (9.00s) +PASS +ok codeberg.org/snonux/algorithms/sort 9.002s +``` + +I won't write any benchmark for sleep sort; that will be done for the algorithms to come in this series :-). + +E-Mail your comments to hi@paul.cyou :-) + +=> ../ Back to the main site diff --git a/gemfeed/2023-04-09-algorithms-in-golang-part-1.gmi.tpl b/gemfeed/2023-04-09-algorithms-in-golang-part-1.gmi.tpl new file mode 100644 index 00000000..a8a583b5 --- /dev/null +++ b/gemfeed/2023-04-09-algorithms-in-golang-part-1.gmi.tpl @@ -0,0 +1,229 @@ +# Algorithms in Go - Part 1 + +> Published at 2023-04-09T21:48:36+03:00 + +``` + ,_---~~~~~----._ + _,,_,*^____ _____``*g*\"*, + / __/ /' ^. / \ ^@q f +[ @f | @)) | | @)) l 0 _/ + \`/ \~____ / __ \_____/ \ + | _l__l_ I + } [______] I + ] | | | | + ] ~ ~ | + | | + | | +``` + +This is the first blog post about my Algorithms in Go series. I am not a Software Developer in my day job. In my current role, programming and scripting skills are desirable but not mandatory. I have been learning about Data Structures and Algorithms many years ago at University. I thought it would be fun to revisit/refresh my knowledge here and implement many of the algorithms in Go. + +<< template::inline::index algorithms-in-golang-part + +This post is about setting up some basic data structures and methods for this blog series. I promise, everything will be easy to follow in this post. + +## Type constraints + +First, the package `ds` (data structures) defines the `types.go`. All examples will either operate on the `Integer` or `Number` type: + +```go +package ds + +import ( + "golang.org/x/exp/constraints" +) + +type Integer interface { + constraints.Integer +} + +type Number interface { + constraints.Integer | constraints.Float +} + +``` + +## ArrayList + +Next comes the `arraylist.go`, which defines the underlying data structure all the algorithms of this series will use. `ArrayList` is just a type alias of a Go array (or slice) with custom methods on it: + +```go +package ds + +import ( + "fmt" + "math/rand" + "strings" +) + +type ArrayList[V Number] []V + +func NewArrayList[V Number](l int) ArrayList[V] { + return make(ArrayList[V], l) +} +``` + +As you can see, the code uses Go generics, which I refactored recently. Besides the default constructor (which only returns an empty `ArrayList` with a given capacity), there are also a bunch of special constructors. `NewRandomArrayList` is returning an `ArrayList` with random numbers, `NewAscendingArrayList` and `NewDescendingArrayList` are returning `ArrayList`s in either ascending or descending order. They all will be used later on for testing and benchmarking the algorithms. + +```go +func NewRandomArrayList[V Number](l, max int) ArrayList[V] { + a := make(ArrayList[V], l) + for i := 0; i < l; i++ { + if max > 0 { + a[i] = V(rand.Intn(max)) + continue + } + a[i] = V(rand.Int()) + } + return a +} + +func NewAscendingArrayList[V Number](l int) ArrayList[V] { + a := make(ArrayList[V], l) + for i := 0; i < l; i++ { + a[i] = V(i) + } + return a +} + +func NewDescendingArrayList[V Number](l int) ArrayList[V] { + a := make(ArrayList[V], l) + j := l - 1 + for i := 0; i < l; i++ { + a[i] = V(j) + j-- + } + return a +} +``` + +## Helper methods + +The `FirstN` method only returns the first N elements of the `ArrayList`. This is useful for printing out only parts of the data structure: + +```go +func (a ArrayList[V]) FirstN(n int) string { + var sb strings.Builder + j := n + + l := len(a) + if j > l { + j = l + } + + for i := 0; i < j; i++ { + fmt.Fprintf(&sb, "%v ", a[i]) + } + + if j < l { + fmt.Fprintf(&sb, "... ") + } + + return sb.String() +} +``` + +The `Sorted` method checks whether the `ArrayList` is sorted. This will be used by the unit tests later on: + +```go +func (a ArrayList[V]) Sorted() bool { + for i := len(a) - 1; i > 0; i-- { + if a[i] < a[i-1] { + return false + } + } + return true +} +``` + +And the last utility method used is `Swap`, which allows swapping the values of two indices in the `ArrayList`: + +```go +func (a ArrayList[V]) Swap(i, j int) { + aux := a[i] + a[i] = a[j] + a[j] = aux +} + +``` + +## Sleep sort + +Let's implement our first algorithm, sleep sort. Sleep sort is a non-traditional and unconventional sorting algorithm based on the idea of waiting a certain amount of time corresponding to the value of each element in the input `ArrayList`. It's more of a fun, creative concept rather than an efficient or practical sorting technique. This is not a sorting algorithm you would use in any production code. As you can imagine, it is quite an inefficient sorting algorithm (it's only listed here as a warm-up exercise). This sorting method may also return false results depending on how the Goroutines are scheduled by the Go runtime. + + +```go +package sort + +import ( + "codeberg.org/snonux/algorithms/ds" + "sync" + "time" +) + +func Sleep[V ds.Integer](a ds.ArrayList[V]) ds.ArrayList[V] { + sorted := ds.NewArrayList[V](len(a)) + + numCh := make(chan V) + var wg sync.WaitGroup + wg.Add(len(a)) + + go func() { + wg.Wait() + close(numCh) + }() + + for _, num := range a { + go func(num V) { + defer wg.Done() + time.Sleep(time.Duration(num) * time.Second) + numCh <- num + }(num) + } + + for num := range numCh { + sorted = append(sorted, num) + } + + return sorted +} +``` + +### Testing + +For testing, we only allow values up to 10, as otherwise, it would take too long to finish: + +```go +package sort + +import ( + "fmt" + "testing" + + "codeberg.org/snonux/algorithms/ds" +) + +func TestSleepSort(t *testing.T) { + a := ds.NewRandomArrayList[int](10, 10) + a = Sleep(a) + if !a.Sorted() { + t.Errorf("Array not sorted: %v", a) + } +} +``` + +As you can see, it takes `9s` here for the algorithm to finish (which is the highest value in the `ArrayList`): + +```sh +❯ go test ./sort -v -run SleepSort +=== RUN TestSleepSort +--- PASS: TestSleepSort (9.00s) +PASS +ok codeberg.org/snonux/algorithms/sort 9.002s +``` + +I won't write any benchmark for sleep sort; that will be done for the algorithms to come in this series :-). + +E-Mail your comments to hi@paul.cyou :-) + +=> ../ Back to the main site diff --git a/gemfeed/atom.xml b/gemfeed/atom.xml index 2ac864ea..4d2e1753 100644 --- a/gemfeed/atom.xml +++ b/gemfeed/atom.xml @@ -1,11 +1,280 @@ - 2023-04-09T14:08:52+03:00 + 2023-04-09T21:48:36+03:00 foo.zone feed To be in the .zone! gemini://foo.zone/ + + Algorithms in Go - Part 1 + + gemini://foo.zone/gemfeed/2023-04-09-algorithms-in-golang-part-1.gmi + 2023-04-09T21:48:36+03:00 + + Paul Buetow + hi@paul.cyou + + This is the first blog post about my Algorithms in Go series. I am not a Software Developer in my day job. In my current role, programming and scripting skills are desirable but not mandatory. I have been learning about Data Structures and Algorithms many years ago at University. I thought it would be fun to revisit/refresh my knowledge here and implement many of the algorithms in Go. + +
+

Algorithms in Go - Part 1


+
+
+         ,_---~~~~~----._         
+  _,,_,*^____      _____``*g*\"*, 
+ / __/ /'     ^.  /      \ ^@q   f 
+[  @f | @))    |  | @))   l  0 _/  
+ \`/   \~____ / __ \_____/    \   
+  |           _l__l_           I   
+  }          [______]           I  
+  ]            | | |            |  
+  ]             ~ ~             |  
+  |                            |   
+   |                           |   
+
+
+This is the first blog post about my Algorithms in Go series. I am not a Software Developer in my day job. In my current role, programming and scripting skills are desirable but not mandatory. I have been learning about Data Structures and Algorithms many years ago at University. I thought it would be fun to revisit/refresh my knowledge here and implement many of the algorithms in Go.
+
+2023-04-09 Algorithms in Go - Part 1 (You are currently reading this)
+
+This post is about setting up some basic data structures and methods for this blog series. I promise, everything will be easy to follow in this post.
+
+

Type constraints


+
+First, the package ds (data structures) defines the types.go. All examples will either operate on the Integer or Number type:
+
+ +
package ds
+
+import (
+	"golang.org/x/exp/constraints"
+)
+
+type Integer interface {
+	constraints.Integer
+}
+
+type Number interface {
+	constraints.Integer | constraints.Float
+}
+
+
+
+

ArrayList


+
+Next comes the arraylist.go, which defines the underlying data structure all the algorithms of this series will use. ArrayList is just a type alias of a Go array (or slice) with custom methods on it:
+
+ +
package ds
+
+import (
+	"fmt"
+	"math/rand"
+	"strings"
+)
+
+type ArrayList[V Number] []V
+
+func NewArrayList[V Number](l int) ArrayList[V] {
+	return make(ArrayList[V], l)
+}
+
+
+As you can see, the code uses Go generics, which I refactored recently. Besides the default constructor (which only returns an empty ArrayList with a given capacity), there are also a bunch of special constructors. NewRandomArrayList is returning an ArrayList with random numbers, NewAscendingArrayList and NewDescendingArrayList are returning ArrayLists in either ascending or descending order. They all will be used later on for testing and benchmarking the algorithms.
+
+ +
func NewRandomArrayList[V Number](l, max int) ArrayList[V] {
+	a := make(ArrayList[V], l)
+	for i := 0; i < l; i++ {
+		if max > 0 {
+			a[i] = V(rand.Intn(max))
+			continue
+		}
+		a[i] = V(rand.Int())
+	}
+	return a
+}
+
+func NewAscendingArrayList[V Number](l int) ArrayList[V] {
+	a := make(ArrayList[V], l)
+	for i := 0; i < l; i++ {
+		a[i] = V(i)
+	}
+	return a
+}
+
+func NewDescendingArrayList[V Number](l int) ArrayList[V] {
+	a := make(ArrayList[V], l)
+	j := l - 1
+	for i := 0; i < l; i++ {
+		a[i] = V(j)
+		j--
+	}
+	return a
+}
+
+
+

Helper methods


+
+The FirstN method only returns the first N elements of the ArrayList. This is useful for printing out only parts of the data structure:
+
+ +
func (a ArrayList[V]) FirstN(n int) string {
+	var sb strings.Builder
+	j := n
+
+	l := len(a)
+	if j > l {
+		j = l
+	}
+
+	for i := 0; i < j; i++ {
+		fmt.Fprintf(&sb, "%v ", a[i])
+	}
+
+	if j < l {
+		fmt.Fprintf(&sb, "... ")
+	}
+
+	return sb.String()
+}
+
+
+The Sorted method checks whether the ArrayList is sorted. This will be used by the unit tests later on:
+
+ +
func (a ArrayList[V]) Sorted() bool {
+	for i := len(a) - 1; i > 0; i-- {
+		if a[i] < a[i-1] {
+			return false
+		}
+	}
+	return true
+}
+
+
+And the last utility method used is Swap, which allows swapping the values of two indices in the ArrayList:
+
+ +
func (a ArrayList[V]) Swap(i, j int) {
+	aux := a[i]
+	a[i] = a[j]
+	a[j] = aux
+}
+
+
+
+

Sleep sort


+
+Let's implement our first algorithm, sleep sort. Sleep sort is a non-traditional and unconventional sorting algorithm based on the idea of waiting a certain amount of time corresponding to the value of each element in the input ArrayList. It's more of a fun, creative concept rather than an efficient or practical sorting technique. This is not a sorting algorithm you would use in any production code. As you can imagine, it is quite an inefficient sorting algorithm (it's only listed here as a warm-up exercise). This sorting method may also return false results depending on how the Goroutines are scheduled by the Go runtime.
+
+
+ +
package sort
+
+import (
+	"codeberg.org/snonux/algorithms/ds"
+	"sync"
+	"time"
+)
+
+func Sleep[V ds.Integer](a ds.ArrayList[V]) ds.ArrayList[V] {
+	sorted := ds.NewArrayList[V](len(a))
+
+	numCh := make(chan V)
+	var wg sync.WaitGroup
+	wg.Add(len(a))
+
+	go func() {
+		wg.Wait()
+		close(numCh)
+	}()
+
+	for _, num := range a {
+		go func(num V) {
+			defer wg.Done()
+			time.Sleep(time.Duration(num) * time.Second)
+			numCh <- num
+		}(num)
+	}
+
+	for num := range numCh {
+		sorted = append(sorted, num)
+	}
+
+	return sorted
+}
+
+
+

Testing


+
+For testing, we only allow values up to 10, as otherwise, it would take too long to finish:
+
+ +
package sort
+
+import (
+	"fmt"
+	"testing"
+
+	"codeberg.org/snonux/algorithms/ds"
+)
+
+func TestSleepSort(t *testing.T) {
+	a := ds.NewRandomArrayList[int](10, 10)
+	a = Sleep(a)
+	if !a.Sorted() {
+		t.Errorf("Array not sorted: %v", a)
+	}
+}
+
+
+As you can see, it takes 9s here for the algorithm to finish (which is the highest value in the ArrayList):
+
+ +
❯ go test ./sort -v -run SleepSort
+=== RUN   TestSleepSort
+--- PASS: TestSleepSort (9.00s)
+PASS
+ok      codeberg.org/snonux/algorithms/sort     9.002s
+
+
+I won't write any benchmark for sleep sort; that will be done for the algorithms to come in this series :-).
+
+E-Mail your comments to hi@paul.cyou :-)
+
+Back to the main site
+
+
+
'Never split the difference' book notes @@ -7847,200 +8116,4 @@ _jgs_\|//_\\|///_\V/_\|//__ - - Perl Poetry - - gemini://foo.zone/gemfeed/2008-06-26-perl-poetry.gmi - 2008-06-26T21:43:51+01:00 - - Paul Buetow - hi@paul.cyou - - Here are some Perl Poems I wrote. They don't do anything useful when you run them, but they don't produce a compiler error either. They only exist for fun and demonstrate what you can do with Perl syntax. - -
-

Perl Poetry


-
-Published at 2008-06-26T21:43:51+01:00; Updated at 2021-05-04
-
-
- '\|/'                                  *
--- * -----
-  /|\      ____
- ' | '    {_   o^>       *
-   :        -_  /)
-   :         (   (        .-''`'.
-   .          \   \      /       \
-   .           \    \   /         \
-                \    `-'           `'.
-                 \    . '        /    `.
-                  \  ( \  )     (     .')
-   ,,   t          '. |  /       |     (
-  '|``_/^\___        '|  |`'-..-'|   ( ()
-_~~|~/_|_|__/|~~~~~~~ |  / ~~~~~ |   | ~~~~~~~~
- -_  |L[|]L|/         | |\ MJP   )   )
-                      ( |(       /  /|
-   ~~ ~  ~ ~~~~       | /\\     / /| |
-                      ||  \\  _/ / | |
-             ~ ~ ~~~ _|| (_/ (___)_| |Nov291999
-                    (__)         (____)
-
-
-Here are some Perl Poems I wrote. They don't do anything useful when you run them, but they don't produce a compiler error either. They only exist for fun and demonstrate what you can do with Perl syntax.
-
-Wikipedia: "Perl poetry is the practice of writing poems that can be compiled as legal Perl code, for example the piece known as Black Perl. Perl poetry is made possible by the large number of English words that are used in the Perl language. New poems are regularly submitted to the community at PerlMonks."
-
-https://en.wikipedia.org/wiki/Perl
-
-

math.pl


-
- -
#!/usr/bin/perl
-
-# (C) 2006 by Paul C. Buetow
-
-goto library for study $math;
-BEGIN { s/earching/ books/ 
-and read $them, $at, $the } library:
-
-our $topics, cos and tan, 
-require strict; import { of, tied $patience };
-
-do { int'egrate'; sub trade; };
-do { exp'onentize' and abs'olutize' };
-study and study and study and study;
-
-foreach $topic ({of, math}) {
-you, m/ay /go, to, limits }
-
-do { not qw/erk / unless $success 
-and m/ove /o;$n and study };
-
-do { int'egrate'; sub trade; };
-do { exp'onentize' and abs'olutize' };
-study and study and study and study;
-
-grep /all/, exp'onents' and cos'inuses';
-/seek results/ for @all, log'4rithms';
-
-'you' =~ m/ay /go, not home 
-unless each %book ne#ars
-$completion;
-
-do { int'egrate'; sub trade; };
-do { exp'onentize' and abs'olutize' };
-
-#at
-home: //ig,'nore', time and sleep $very =~ s/tr/on/g;
-__END__
-
-
-
-

christmas.pl


-
- -
#!/usr/bin/perl
-
-# (C) 2006 by Paul C. Buetow
-
-Christmas:{time;#!!!
-
-Children: do tell $wishes;
-
-Santa: for $each (@children) { 
-BEGIN { read $each, $their, wishes and study them; use Memoize#ing
-
-} use constant gift, 'wrapping'; 
-package Gifts; pack $each, gift and bless $each and goto deliver
-or do import if not local $available,!!! HO, HO, HO;
-
-redo Santa, pipe $gifts, to_childs;
-redo Santa and do return if last one, is, delivered; 
-
-deliver: gift and require diagnostics if our $gifts ,not break;
-do{ use NEXT; time; tied $gifts} if broken and dump the, broken, ones;
-The_children: sleep and wait for (each %gift) and try { to => untie $gifts };
-
-redo Santa, pipe $gifts, to_childs;
-redo Santa and do return if last one, is, delivered; 
-
-The_christmas_tree: formline s/ /childrens/, $gifts;
-alarm and warn if not exists $Christmas{ tree}, @t, $ENV{HOME};  
-write <<EMail
- to the parents to buy a new christmas tree!!!!111
- and send the
-EMail
-;wait and redo deliver until defined local $tree;
-
-redo Santa, pipe $gifts, to_childs;
-redo Santa and do return if last one, is, delivered ;}
-
-END {} our $mission and do sleep until next Christmas ;}
-
-__END__
-
-This is perl, v5.8.8 built for i386-freebsd-64int
-
-
-

shopping.pl


-
- -
#!/usr/bin/perl
-
-# (C) 2007 by Paul C. Buetow
-
-BEGIN{} goto mall for $shopping; 
-
-m/y/; mall: seek$s, cool products(), { to => $sell };
-for $their (@business) { to:; earn:; a:; lot:; of:; money: }
-
-do not goto home and exit mall if exists $new{product};
-foreach $of (q(uality rich products)){} package products; 
-
-our $news; do tell cool products() and do{ sub#tract
-cool{ $products and shift @the, @bad, @ones;
-
-do bless [q(uality)], $products 
-and return not undef $stuff if not (local $available) }};
-
-do { study and study and study for cool products() }
-and do { seek $all, cool products(), { to => $buy } };
-
-do { write $them, $down } and do { order: foreach (@case) { package s } };
-goto home if not exists $more{money} or die q(uerying) ;for( @money){};
-
-at:;home: do { END{} and:; rest:; a:; bit: exit $shopping } 
-and sleep until unpack$ing, cool products();
-
-__END__
-This is perl, v5.8.8 built for i386-freebsd-64int
-
-
-

More...


-
-Did you like what you saw? Have a look at Codeberg to see my other poems too:
-
-https://codeberg.org/snonux/perl-poetry
-
-Other related posts are:
-
-2022-05-27 Perl is still a great choice
-2011-05-07 Perl Daemon (Service Framework)
-2008-06-26 Perl Poetry (You are currently reading this)
-
-E-Mail your comments to hi@paul.cyou :-)
-
-Back to the main site
-
-
-
diff --git a/gemfeed/index.gmi b/gemfeed/index.gmi index 6e171263..c52c8519 100644 --- a/gemfeed/index.gmi +++ b/gemfeed/index.gmi @@ -2,6 +2,7 @@ ## To be in the .zone! +=> ./2023-04-09-algorithms-in-golang-part-1.gmi 2023-04-09 - Algorithms in Go - Part 1 => ./2023-04-01-never-split-the-difference-book-notes.gmi 2023-04-01 - 'Never split the difference' book notes => ./2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.gmi 2023-03-25 - Gemtexter 2.0.0 - Let's Gemtext again^2 => ./2023-03-16-the-pragmatic-programmer-book-notes.gmi 2023-03-16 - 'The Pragmatic Programmer' book notes diff --git a/index.gmi b/index.gmi index a119d244..b35e5f09 100644 --- a/index.gmi +++ b/index.gmi @@ -1,6 +1,6 @@ # foo.zone -> This site was generated at 2023-04-09T15:24:16+03:00 by `Gemtexter` +> This site was generated at 2023-04-09T21:48:36+03:00 by `Gemtexter` ``` |\---/| @@ -32,6 +32,7 @@ If you reach this site via the modern web, please read this: ### Posts +=> ./gemfeed/2023-04-09-algorithms-in-golang-part-1.gmi 2023-04-09 - Algorithms in Go - Part 1 => ./gemfeed/2023-04-01-never-split-the-difference-book-notes.gmi 2023-04-01 - 'Never split the difference' book notes => ./gemfeed/2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.gmi 2023-03-25 - Gemtexter 2.0.0 - Let's Gemtext again^2 => ./gemfeed/2023-03-16-the-pragmatic-programmer-book-notes.gmi 2023-03-16 - 'The Pragmatic Programmer' book notes diff --git a/uptime-stats.gmi b/uptime-stats.gmi index e5f85219..000eb5a9 100644 --- a/uptime-stats.gmi +++ b/uptime-stats.gmi @@ -1,6 +1,6 @@ # My machine uptime stats -> This site was last updated at 2023-04-09T15:24:16+03:00 +> This site was last updated at 2023-04-09T21:48:36+03:00 The following stats were collected via `uptimed` on all of my personal computers over many years and the output was generated by `guprecords`, the global uptime records stats analyser of mine. -- cgit v1.2.3