diff options
56 files changed, 1532 insertions, 3885 deletions
diff --git a/gemfeed/2008-06-26-perl-poetry.html b/gemfeed/2008-06-26-perl-poetry.html index 2e3c8bdc..8548d656 100644 --- a/gemfeed/2008-06-26-perl-poetry.html +++ b/gemfeed/2008-06-26-perl-poetry.html @@ -9,8 +9,7 @@ </head> <body> <h1>Perl Poetry</h1> -<span class="quote"><i>Published at 2008-06-26T21:43:51+01:00; Updated at 2021-05-04</i></span><br /> -<br /> +<p class="quote"><i>Published at 2008-06-26T21:43:51+01:00; Updated at 2021-05-04</i></p> <pre> '\|/' * -- * ----- @@ -33,13 +32,9 @@ _~~|~/_|_|__/|~~~~~~~ | / ~~~~~ | | ~~~~~~~~ ~ ~ ~~~ _|| (_/ (___)_| |Nov291999 (__) (____) </pre> -<br /> -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.<br /> -<br /> -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."<br /> -<br /> +<p>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.</p> +<p>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."</p> <a class="textlink" href="https://en.wikipedia.org/wiki/Perl">https://en.wikipedia.org/wiki/Perl</a><br /> -<br /> <h2>math.pl</h2> <pre> #!/usr/bin/perl @@ -82,7 +77,6 @@ home: //ig,'nore', time and sleep $very =~ s/tr/on/g; __END__ </pre> -<br /> <h2>christmas.pl</h2> <pre> #!/usr/bin/perl @@ -127,7 +121,6 @@ __END__ This is perl, v5.8.8 built for i386-freebsd-64int </pre> -<br /> <h2>shopping.pl</h2> <pre> #!/usr/bin/perl @@ -160,20 +153,14 @@ and sleep until unpack$ing, cool products(); __END__ This is perl, v5.8.8 built for i386-freebsd-64int </pre> -<br /> <h2>More...</h2> -Did you like what you saw? Have a look at Codeberg to see my other poems too:<br /> -<br /> +<p>Did you like what you saw? Have a look at Codeberg to see my other poems too:</p> <a class="textlink" href="https://codeberg.org/snonux/perl-poetry">https://codeberg.org/snonux/perl-poetry</a><br /> -<br /> -Other related posts are:<br /> -<br /> +<p>Other related posts are:</p> <a class="textlink" href="./2022-05-27-perl-is-still-a-great-choice.html">2022-05-27 Perl is still a great choice</a><br /> <a class="textlink" href="./2011-05-07-perl-daemon-service-framework.html">2011-05-07 Perl Daemon (Service Framework)</a><br /> <a class="textlink" href="./2008-06-26-perl-poetry.html">2008-06-26 Perl Poetry (You are currently reading this)</a><br /> -<br /> -E-Mail your comments to hi@paul.cyou :-)<br /> -<br /> +<p>E-Mail your comments to hi@paul.cyou :-)</p> <a class="textlink" href="../">Back to the main site</a><br /> <p class="footer"> Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter</a> | 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 941e4a65..88ed6062 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 @@ -9,8 +9,7 @@ </head> <body> <h1>Using my Nokia N95 for fixing my MTA</h1> -<span class="quote"><i>Published at 2008-12-29T09:10:41+00:00; Updated at 2021-12-01</i></span><br /> -<br /> +<p class="quote"><i>Published at 2008-12-29T09:10:41+00:00; Updated at 2021-12-01</i></p> <pre> _ @@ -27,28 +26,19 @@ _jgs_\|//_\\|///_\V/_\|//__ Art by Joan Stark </pre> -<br /> -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). <br /> -<br /> -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). <br /> -<br /> +<p>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). </p> +<p>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). </p> <a href="./2008-12-29-using-my-nokia-n95-for-fixing-my-mta/nokia-n95.jpg"><img alt="Picture of a Nokia N95" title="Picture of a Nokia N95" src="./2008-12-29-using-my-nokia-n95-for-fixing-my-mta/nokia-n95.jpg" /></a><br /> -<br /> -With Putty for N95 and configuring Postfix with Vim and the T9 input mechanism, I managed to fix the problem. But it took half of an hour:<br /> -<br /> +<p>With Putty for N95 and configuring Postfix with Vim and the T9 input mechanism, I managed to fix the problem. But it took half of an hour:</p> <ul> <li>First, getting a shell prompt</li> <li>Second, use the "tail" command to analyse the Postfix logs</li> <li>Third, use the "sed" command to fix a syntax error in the Postfix config</li> <li>Fourth, restart Postfix</li> </ul> -<br /> -It was a pain in the ass. My next mobile phone MUST have a full QWERTY keyboard. This would have made my life lots easier. :)<br /> -<br /> -At the moment I am in Sofia, Bulgaria. Here I can use at least an unprotected WLAN hotspot which belongs to one of the neighbours which I don’t know in person, and it is not blocking any port at all :)<br /> -<br /> -E-Mail your comments to hi@paul.cyou :-)<br /> -<br /> +<p>It was a pain in the ass. My next mobile phone MUST have a full QWERTY keyboard. This would have made my life lots easier. :)</p> +<p>At the moment I am in Sofia, Bulgaria. Here I can use at least an unprotected WLAN hotspot which belongs to one of the neighbours which I don’t know in person, and it is not blocking any port at all :)</p> +<p>E-Mail your comments to hi@paul.cyou :-)</p> <a class="textlink" href="../">Back to the main site</a><br /> <p class="footer"> Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter</a> | diff --git a/gemfeed/2010-04-09-standard-ml-and-haskell.html b/gemfeed/2010-04-09-standard-ml-and-haskell.html index fde33f72..13f18715 100644 --- a/gemfeed/2010-04-09-standard-ml-and-haskell.html +++ b/gemfeed/2010-04-09-standard-ml-and-haskell.html @@ -9,26 +9,19 @@ </head> <body> <h1>Standard ML and Haskell</h1> -<span class="quote"><i>Published at 2010-04-09T22:57:36+01:00</i></span><br /> -<br /> -I am currently looking into the functional programming language Standard ML (aka SML). The purpose is to refresh my functional programming skills and to learn something new too. Since I already knew a little Haskell, I could not help myself, and I also implemented the same exercises in Haskell.<br /> -<br /> -As you will see, SML and Haskell are very similar (at least when it comes to the basics). However, the syntax of Haskell is a bit more "advanced". Haskell utilizes fewer keywords (e.g. no val, end, fun, fn ...). Haskell also allows to write down the function types explicitly. What I have been missing in SML so far is the so-called pattern guards. Although this is a very superficial comparison for now, so far, I like Haskell more than SML. Nevertheless, I thought it would be fun to demonstrate a few simple functions of both languages to show off the similarities. <br /> -<br /> -Haskell is also a "pure functional" programming language, whereas SML also makes explicit use of imperative concepts. I am by far not a specialist in either of these languages, but here are a few functions implemented in both SML and Haskell:<br /> -<br /> +<p class="quote"><i>Published at 2010-04-09T22:57:36+01:00</i></p> +<p>I am currently looking into the functional programming language Standard ML (aka SML). The purpose is to refresh my functional programming skills and to learn something new too. Since I already knew a little Haskell, I could not help myself, and I also implemented the same exercises in Haskell.</p> +<p>As you will see, SML and Haskell are very similar (at least when it comes to the basics). However, the syntax of Haskell is a bit more "advanced". Haskell utilizes fewer keywords (e.g. no val, end, fun, fn ...). Haskell also allows to write down the function types explicitly. What I have been missing in SML so far is the so-called pattern guards. Although this is a very superficial comparison for now, so far, I like Haskell more than SML. Nevertheless, I thought it would be fun to demonstrate a few simple functions of both languages to show off the similarities. </p> +<p>Haskell is also a "pure functional" programming language, whereas SML also makes explicit use of imperative concepts. I am by far not a specialist in either of these languages, but here are a few functions implemented in both SML and Haskell:</p> <h2>Defining a multi-data type</h2> -Standard ML:<br /> -<br /> +<p>Standard ML:</p> <pre> datatype ’a multi = EMPTY | ELEM of ’a | UNION of ’a multi * ’a multi </pre> -<br /> -Haskell:<br /> -<br /> +<p>Haskell:</p> <pre> data (Eq a) => Multi a = Empty @@ -36,10 +29,8 @@ data (Eq a) => Multi a | Union (Multi a) (Multi a) deriving Show </pre> -<br /> <h2>Processing a multi</h2> -Standard ML:<br /> -<br /> +<p>Standard ML:</p> <pre> fun number (EMPTY) _ = 0 | number (ELEM x) w = if x = w then 1 else 0 @@ -48,9 +39,7 @@ fun test_number w = number (UNION (EMPTY, \ UNION (ELEM 4, UNION (ELEM 6, \ UNION (UNION (ELEM 4, ELEM 4), EMPTY))))) w </pre> -<br /> -Haskell:<br /> -<br /> +<p>Haskell:</p> <pre> number Empty _ = 0 number (Elem x) w = if x == w then 1 else 0 @@ -58,10 +47,8 @@ test_number w = number (Union Empty \ (Union (Elem 4) (Union (Elem 6) \ (Union (Union (Elem 4) (Elem 4)) Empty)))) w </pre> -<br /> <h2>Simplify function</h2> -Standard ML:<br /> -<br /> +<p>Standard ML:</p> <pre> fun simplify (UNION (x,y)) = let fun is_empty (EMPTY) = true | is_empty _ = false @@ -77,9 +64,7 @@ fun simplify (UNION (x,y)) = end | simplify x = x </pre> -<br /> -Haskell:<br /> -<br /> +<p>Haskell:</p> <pre> simplify (Union x y) | (isEmpty x’) && (isEmpty y’) = Empty @@ -93,10 +78,8 @@ simplify (Union x y) y’ = simplify y simplify x = x </pre> -<br /> <h2>Delete all</h2> -Standard ML:<br /> -<br /> +<p>Standard ML:</p> <pre> fun delete_all m w = let fun delete_all’ (ELEM x) = if x = w then EMPTY else ELEM x @@ -105,9 +88,7 @@ fun delete_all m w = in simplify (delete_all’ m) end </pre> -<br /> -Haskell:<br /> -<br /> +<p>Haskell:</p> <pre> delete_all m w = simplify (delete_all’ m) where @@ -115,10 +96,8 @@ delete_all m w = simplify (delete_all’ m) delete_all’ (Union x y) = Union (delete_all’ x) (delete_all’ y) delete_all’ x = x </pre> -<br /> <h2>Delete one</h2> -Standard ML:<br /> -<br /> +<p>Standard ML:</p> <pre> fun delete_one m w = let fun delete_one’ (UNION (x,y)) = @@ -136,9 +115,7 @@ fun delete_one m w = in simplify m’ end </pre> -<br /> -Haskell:<br /> -<br /> +<p>Haskell:</p> <pre> delete_one m w = do let (m’, _) = delete_one’ m @@ -154,10 +131,8 @@ delete_one m w = do if x == w then (Empty, True) else (Elem x, False) delete_one’ x = (x, False) </pre> -<br /> <h2>Higher-order functions</h2> -The first line is always the SML code, the second line the Haskell variant:<br /> -<br /> +<p>The first line is always the SML code, the second line the Haskell variant:</p> <pre> fun make_map_fn f1 = fn (x,y) => f1 x :: y make_map_fn f1 = \x y -> f1 x : y @@ -171,9 +146,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 </pre> -<br /> -E-Mail your comments to hi@paul.cyou :-)<br /> -<br /> +<p>E-Mail your comments to hi@paul.cyou :-)</p> <a class="textlink" href="../">Back to the main site</a><br /> <p class="footer"> Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter</a> | diff --git a/gemfeed/2010-05-07-lazy-evaluation-with-standarn-ml.html b/gemfeed/2010-05-07-lazy-evaluation-with-standarn-ml.html index 3c24c93e..4a98a243 100644 --- a/gemfeed/2010-05-07-lazy-evaluation-with-standarn-ml.html +++ b/gemfeed/2010-05-07-lazy-evaluation-with-standarn-ml.html @@ -9,8 +9,7 @@ </head> <body> <h1>Lazy Evaluation with Standard ML</h1> -<span class="quote"><i>Published at 2010-05-07T08:17:59+01:00</i></span><br /> -<br /> +<p class="quote"><i>Published at 2010-05-07T08:17:59+01:00</i></p> <pre> _____|~~\_____ _____________ @@ -23,18 +22,12 @@ `---------------'--\\\\ .`--' -Glyde- `|||| </pre> -<br /> -In contrast to Haskell, Standard SML does not use lazy evaluation by default but an eager evaluation. <br /> -<br /> +<p>In contrast to Haskell, Standard SML does not use lazy evaluation by default but an eager evaluation. </p> <a class="textlink" href="https://en.wikipedia.org/wiki/Eager_evaluation">https://en.wikipedia.org/wiki/Eager_evaluation</a><br /> <a class="textlink" href="https://en.wikipedia.org/wiki/Lazy_evaluation">https://en.wikipedia.org/wiki/Lazy_evaluation</a><br /> -<br /> -<br /> -You can solve specific problems with lazy evaluation easier than with eager evaluation. For example, you might want to list the number Pi or another infinite list of something. With the help of lazy evaluation, each element of the list is calculated when it is accessed first, but not earlier.<br /> -<br /> +<p>You can solve specific problems with lazy evaluation easier than with eager evaluation. For example, you might want to list the number Pi or another infinite list of something. With the help of lazy evaluation, each element of the list is calculated when it is accessed first, but not earlier.</p> <h2>Emulating lazy evaluation in SML</h2> -However, it is possible to emulate lazy evaluation in most eager evaluation languages. This is how it is done with Standard ML (with some play with an infinite list of natural number tuples filtering out 0 elements):<br /> -<br /> +<p>However, it is possible to emulate lazy evaluation in most eager evaluation languages. This is how it is done with Standard ML (with some play with an infinite list of natural number tuples filtering out 0 elements):</p> <pre> type ’a lazy = unit -> ’a; @@ -74,12 +67,9 @@ fun nat_pairs_not_null () = val test = first 10 (nat_pairs_not_null ()); *) </pre> -<br /> <a class="textlink" href="http://smlnj.org/">http://smlnj.org/</a><br /> -<br /> <h2>Real laziness with Haskell </h2> -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. <br /> -<br /> +<p>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. </p> <pre> {- Just to make it look like the ML example -} first = take @@ -101,11 +91,8 @@ nat_pairs_not_null = filters (\[x,y] -> x > 0 && y > 0) nat_pai first 10 nat_pairs_not_null -} </pre> -<br /> <a class="textlink" href="http://www.haskell.org/">http://www.haskell.org/</a><br /> -<br /> -E-Mail your comments to hi@paul.cyou :-)<br /> -<br /> +<p>E-Mail your comments to hi@paul.cyou :-)</p> <a class="textlink" href="../">Back to the main site</a><br /> <p class="footer"> Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter</a> | diff --git a/gemfeed/2010-05-09-the-fype-programming-language.html b/gemfeed/2010-05-09-the-fype-programming-language.html index f568b19e..7aa1517d 100644 --- a/gemfeed/2010-05-09-the-fype-programming-language.html +++ b/gemfeed/2010-05-09-the-fype-programming-language.html @@ -9,8 +9,7 @@ </head> <body> <h1>The Fype Programming Language</h1> -<span class="quote"><i>Published at 2010-05-09T12:48:29+01:00; Updated at 2021-05-05</i></span><br /> -<br /> +<p class="quote"><i>Published at 2010-05-09T12:48:29+01:00; Updated at 2021-05-05</i></p> <pre> ____ _ __ / / _|_ _ _ __ ___ _ _ ___ __ _| |__ / _|_ _ @@ -19,18 +18,12 @@ (_)_/ |_| \__, | .__/ \___| \__, |\___|\__,_|_| |_(_)_| \__, | |___/|_| |___/ |___/ </pre> -<br /> -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.<br /> -<br /> -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. <br /> -<br /> -Fype is a recursive acronym and means "Fype is For Your Program Execution" or "Fype is Free Yak Programmed for ELF". You could also say, "It's not a hype - it's Fype!".<br /> -<br /> +<p>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.</p> +<p>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. </p> +<p>Fype is a recursive acronym and means "Fype is For Your Program Execution" or "Fype is Free Yak Programmed for ELF". You could also say, "It's not a hype - it's Fype!".</p> <h2>Object-oriented C style</h2> -The Fype interpreter is written in an object-oriented style of C. Each "main component" has its own .h and .c file. There is a struct type for each (most components at least) component, which can be initialized using a "COMPONENT_new" function and destroyed using a "COMPONENT_delete" function. Method calls follow the same schema, e.g. "COMPONENT_METHODNAME". There is no such as class inheritance and polymorphism involved. <br /> -<br /> -To give you an idea of how it works here as an example is a snippet from the main Fype "class header":<br /> -<br /> +<p>The Fype interpreter is written in an object-oriented style of C. Each "main component" has its own .h and .c file. There is a struct type for each (most components at least) component, which can be initialized using a "COMPONENT_new" function and destroyed using a "COMPONENT_delete" function. Method calls follow the same schema, e.g. "COMPONENT_METHODNAME". There is no such as class inheritance and polymorphism involved. </p> +<p>To give you an idea of how it works here as an example is a snippet from the main Fype "class header":</p> <pre> typedef struct { Tupel *p_tupel_argv; // Contains command line options @@ -39,9 +32,7 @@ typedef struct { char *c_basename; } Fype; </pre> -<br /> -And here is a snippet from the primary Fype "class implementation":<br /> -<br /> +<p>And here is a snippet from the primary Fype "class implementation":</p> <pre> Fype* fype_new() { @@ -91,9 +82,8 @@ fype_run(int i_argc, char **pc_argv) { return (0); } </pre> -<br /> <h2>Data types</h2> -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:<br /> +<p>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:</p> <ul> <li>integer - Specifies a number</li> <li>double - Specifies a double-precision number</li> @@ -103,16 +93,12 @@ Fype uses auto type conversion. However, if you want to know what's going on, yo <li>void - No type</li> <li>identifier - It's a variable name or a procedure name, or a function name</li> </ul> -<br /> -There is no boolean type, but we can use the integer values 0 for false and 1 for true. There is support for explicit type casting too.<br /> -<br /> +<p>There is no boolean type, but we can use the integer values 0 for false and 1 for true. There is support for explicit type casting too.</p> <h2>Syntax</h2> <h3>Comments</h3> -Text from a # character until the end of the current line is considered being a comment. Multi-line comments may start with an #* and with a *# anywhere. Exceptions are if those signs are inside of strings.<br /> -<br /> +<p>Text from a # character until the end of the current line is considered being a comment. Multi-line comments may start with an #* and with a *# anywhere. Exceptions are if those |
