From e4676049f25c5fa0cb645d1555934fda88029fd5 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Wed, 15 Jun 2022 08:54:26 +0100 Subject: sweating the small stuff --- gemfeed/2008-06-26-perl-poetry.html | 8 +- ...12-29-using-my-nokia-n95-for-fixing-my-mta.html | 2 +- gemfeed/2010-04-09-standard-ml-and-haskell.html | 22 +- ...010-05-07-lazy-evaluation-with-standarn-ml.html | 6 +- .../2010-05-09-the-fype-programming-language.html | 74 +-- .../2011-05-07-perl-daemon-service-framework.html | 18 +- .../2014-03-24-the-fibonacci.pl.c-polyglot.html | 6 +- ...2-05-run-debian-on-your-phone-with-debroid.html | 14 +- gemfeed/2016-04-03-offsite-backup-with-zfs.html | 4 +- ...04-09-jails-and-zfs-on-freebsd-with-puppet.html | 16 +- .../2016-04-16-offsite-backup-with-zfs-part2.html | 5 +- ...inning-up-my-own-authoritative-dns-servers.html | 14 +- ...20-object-oriented-programming-with-ansi-c.html | 12 +- ...alistic-load-testing-with-ioriot-for-linux.html | 16 +- ...-22-dtail-the-distributed-log-tail-program.html | 2 +- gemfeed/2021-04-24-welcome-to-the-geminispace.html | 2 +- ...021-05-16-personal-bash-coding-style-guide.html | 48 +- ...5-gemtexter-one-bash-script-to-rule-it-all.html | 8 +- gemfeed/2021-07-04-the-well-grounded-rubyist.html | 2 +- ...-08-01-on-being-pedantic-about-open-source.html | 2 +- gemfeed/2021-09-12-keep-it-simple-and-stupid.html | 2 +- gemfeed/2021-10-22-defensive-devops.html | 2 +- gemfeed/2021-11-29-bash-golf-part-1.html | 78 +-- ...-12-26-how-to-stay-sane-as-a-devops-person.html | 2 +- gemfeed/2022-01-01-bash-golf-part-2.html | 66 +- gemfeed/2022-01-23-welcome-to-the-foo.zone.html | 2 +- ...022-02-04-computer-operating-systems-i-use.html | 4 +- gemfeed/2022-03-06-the-release-of-dtail-4.0.0.html | 26 +- gemfeed/2022-04-10-creative-universe.html | 4 +- .../2022-05-27-perl-is-still-a-great-choice.html | 2 +- gemfeed/atom.xml | 711 ++++++++++++++------- gemfeed/index.html | 1 + index.html | 3 +- other-resources.html | 2 +- resources.html | 2 +- style.css | 6 + 36 files changed, 724 insertions(+), 470 deletions(-) diff --git a/gemfeed/2008-06-26-perl-poetry.html b/gemfeed/2008-06-26-perl-poetry.html index 996ffcb9..b78c4351 100644 --- a/gemfeed/2008-06-26-perl-poetry.html +++ b/gemfeed/2008-06-26-perl-poetry.html @@ -30,7 +30,7 @@ _~~|~/_|_|__/|~~~~~~~ | / ~~~~~ | | ~~~~~~~~ || \\ _/ / | | ~ ~ ~~~ _|| (_/ (___)_| |Nov291999 (__) (____) - +

Published by Paul at 2008-06-26, last updated at 2021-05-04

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."

@@ -76,7 +76,7 @@ do { exp'onentize' and abs'olutize' }; home: //ig,'nore', time and sleep $very =~ s/tr/on/g; __END__ - +

christmas.pl

 #!/usr/bin/perl
@@ -120,7 +120,7 @@ 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
@@ -152,7 +152,7 @@ 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
diff --git a/gemfeed/2008-12-29-using-my-nokia-n95-for-fixing-my-mta.html b/gemfeed/2008-12-29-using-my-nokia-n95-for-fixing-my-mta.html index d00106f1..cf7b033e 100644 --- a/gemfeed/2008-12-29-using-my-nokia-n95-for-fixing-my-mta.html +++ b/gemfeed/2008-12-29-using-my-nokia-n95-for-fixing-my-mta.html @@ -24,7 +24,7 @@ \|/ \\|| \\| |// _jgs_\|//_\\|///_\V/_\|//__ Art by Joan Stark - +

Published by Paul at 2008-12-29, last updated at 2021-12-01

The last week I was in Vidin, Bulgaria with no internet access and I had to fix my MTA (Postfix) at host.0.buetow.org which serves E-Mail for all my customers at P. B. Labs. Good, that I do not guarantee high availability on my web services (I've to do a full time job somewhere else too).

My first attempt to find an internet café, which was working during Christmastime, failed. However, I found with my N95 phone lots of free WLAN hotspots. The hotspots refused me logging into my server using SSH as I have configured a non-standard port for SSH for security reasons. Without knowing the costs, I used the GPRS internet access of my German phone provider (yes, I had to pay roaming fees).

diff --git a/gemfeed/2010-04-09-standard-ml-and-haskell.html b/gemfeed/2010-04-09-standard-ml-and-haskell.html index c1e26db2..e99e71dd 100644 --- a/gemfeed/2010-04-09-standard-ml-and-haskell.html +++ b/gemfeed/2010-04-09-standard-ml-and-haskell.html @@ -20,7 +20,7 @@ datatype ’a multi = EMPTY | ELEM of ’a | UNION of ’a multi * ’a multi - +

Haskell:

 data (Eq a) => Multi a
@@ -28,7 +28,7 @@ data (Eq a) => Multi a
     | Elem a
     | Union (Multi a) (Multi a)
     deriving Show
-
+

Processing a multi

Standard ML:

@@ -38,7 +38,7 @@ fun number (EMPTY) _ = 0
 fun test_number w = number (UNION (EMPTY, \
     UNION (ELEM 4, UNION (ELEM 6, \
     UNION (UNION (ELEM 4, ELEM 4), EMPTY))))) w 
-
+

Haskell:

 number Empty _ = 0
@@ -46,7 +46,7 @@ number (Elem x) w = if x == w then 1 else 0
 test_number w = number (Union Empty \
     (Union (Elem 4) (Union (Elem 6) \
     (Union (Union (Elem 4) (Elem 4)) Empty)))) w
-
+

Simplify function

Standard ML:

@@ -63,7 +63,7 @@ fun simplify (UNION (x,y)) =
        else UNION (x’, y’)
     end
   | simplify x = x
-
+

Haskell:

 simplify (Union x y)
@@ -77,7 +77,7 @@ simplify (Union x y)
         x’ = simplify x
         y’ = simplify y
 simplify x = x
-
+

Delete all

Standard ML:

@@ -87,7 +87,7 @@ fun delete_all m w =
           | delete_all’ x = x
     in simplify (delete_all’ m)
     end
-
+

Haskell:

 delete_all m w = simplify (delete_all’ m)
@@ -95,7 +95,7 @@ delete_all m w = simplify (delete_all’ m)
         delete_all’ (Elem x) = if x == w then Empty else Elem x
         delete_all’ (Union x y) = Union (delete_all’ x) (delete_all’ y)
         delete_all’ x = x
-
+

Delete one

Standard ML:

@@ -114,7 +114,7 @@ fun delete_one m w =
             val (m’, _) = delete_one’ m
         in simplify m’
     end
-
+

Haskell:

 delete_one m w = do
@@ -130,7 +130,7 @@ delete_one m w = do
         delete_one’ (Elem x) =
             if x == w then (Empty, True) else (Elem x, False)
         delete_one’ x = (x, False)
-
+

Higher-order functions

The first line is always the SML code, the second line the Haskell variant:

@@ -145,7 +145,7 @@ my_map f l = foldr (make_map_fn f) [] l
 
 fun my_filter f l = foldr (make_filter_fn f) [] l
 my_filter f l = foldr (make_filter_fn f) [] l
-
+

E-Mail me your comments to paul at buetow dot org!

Go back to the main site

Published by Paul at 2010-05-07

In contrast to Haskell, Standard SML does not use lazy evaluation by default but an eager evaluation.

https://en.wikipedia.org/wiki/Eager_evaluation
@@ -66,7 +66,7 @@ fun nat_pairs_not_null () = (* Test val test = first 10 (nat_pairs_not_null ()); *) - +
http://smlnj.org/

Real laziness with Haskell

As Haskell already uses lazy evaluation by default, there is no need to construct a new data type. Lists in Haskell are lazy by default. You will notice that the code is also much shorter and easier to understand than the SML version.

@@ -90,7 +90,7 @@ nat_pairs_not_null = filters (\[x,y] -> x > 0 && y > 0) nat_pai {- Test: first 10 nat_pairs_not_null -} - +
http://www.haskell.org/

E-Mail me your comments to paul at buetow dot org!

Go back to the main site
diff --git a/gemfeed/2010-05-09-the-fype-programming-language.html b/gemfeed/2010-05-09-the-fype-programming-language.html index 7a8cf903..377ababa 100644 --- a/gemfeed/2010-05-09-the-fype-programming-language.html +++ b/gemfeed/2010-05-09-the-fype-programming-language.html @@ -16,7 +16,7 @@ _ / /| _| |_| | |_) | __/ | |_| | __/ (_| | | | |_| _| |_| | (_)_/ |_| \__, | .__/ \___| \__, |\___|\__,_|_| |_(_)_| \__, | |___/|_| |___/ |___/ - +

Published by Paul at 2010-05-09, last updated at 2021-05-05

Fype is an interpreted programming language created by me for learning and fun. The interpreter is written in C. It has been tested on FreeBSD and NetBSD and may also work on other Unix like operating systems such as Linux based ones. Besides learning and fun, there is no other use case of why Fype exists as many other programming languages are much faster and more powerful.

The Fype syntax is straightforward and uses a maximum look ahead of 1 and an effortless top-down parsing mechanism. Fype is parsing and interpreting its code simultaneously. This means that syntax errors are only detected during program runtime.

@@ -31,7 +31,7 @@ typedef struct { Hash *p_hash_syms; // Symbol table char *c_basename; } Fype; - +

And here is a snippet from the primary Fype "class implementation":

 Fype*
@@ -81,7 +81,7 @@ fype_run(int i_argc, char **pc_argv) {
 
    return (0);
 }
-
+

Data types

Fype uses auto type conversion. However, if you want to know what's going on, you may take a look at the following basic data types: