Let us Have a Productive Year of 2021


Bye, 2020

There are 28 entries on this blog in the Year 2020.

In February, I started to join "The Weekly Challenge"(PWC in short, as initially it was called "Perl Weekly Challenge" while the name "Perl6" hadn't been replaced by Raku). Then I slowly involved in the Perl community as a beginner.

At first, my codes were messy! I have forgotten from where I heard of Perl Best Practices(by Damian Conway; btw, I have to revisit it again), but have been trying to adopt some of its pieces of advice as many as possible. And then I read more codes and decided to maintain my code more modularized and structured; in addition, I have learnt to use the unit testing package in Perl (thanks to Perl Monks).

At a very early time, I just wanted to use programming for my amateur mathematician dream. My codes are encouraged by the code reviewer Ryan Thompson as "analytic". The second week I joined PWC, I hit on my favorite stuff ‒ number theory in math. I provided a different but optimized solution. [1] It started a series of email conversations between Ryan and me. Besides "hard knowledge" of Perl I learnt from the discussion, I started blogging here with his encouragement.

One of my foremost posts, on my initial plan, is to learn the object-oriented side of Perl, hasn't been really started. In November, I started to learning Java seriously; see if an "OOP-oriented" language can help me to achieve my plan on OO Perl. In addition or in a more practical concern, learning Java is to achieve my aimed career field. (I don't want to work in Food and Beverage in Hong Kong anymore... Sorry for having to keep the story private.) (By the way, for some schema or applications, Perl cannot be a good choice for novices. I found some Perl books often assume readers having knowledge of C or Linux. Anyway I have switched to Linux in the middle of 2020. :P )

Happily, I got the PWC monthly champion title with an Amazon book coupon (sponsored by Perl Careers) in August.

One of the books I bought by the coupon is Mastering Algorithms with Perl (by John MacDonald)(an eye-opener!).

In December, I joined the famous coding yearly event "Advent Of Code". 22 "golden stars" are got (the full score is 48 golden stars); mostly through Java, one or two through a combination of Java and Perl; and, a day I completed it with Perl.

Those two tasks are clothed with basic arithmetic and I found how convenient to deal them with Perl. Actually I was slacking as I have observed the maximum number of layers of brackets of the raw data is two, so a subroutine killparentheses were used twice. My script is unable to be solved for general cases effectively.

The Weekly Challenge #089 ~ #093

Now, it is time to pay some debt ‒ a part of the debt is skipping blogging for PWC four weeks, the other part is completing more details on my previously submitted codes.


+ Task 2 Magic Sum

After coding and submission, I suddenly worried that the unchecked equations. Luckily "the sum of a face minus the sums of two segments" is the sum of a segment.

Seems it is just my luck. (Original blogpost.)



+ Task 1 DNA sequence

My solution is not optimal as it visited the sequence four times. Well, poor concern.

By the way, I came across a good website, http://rosalind.info .

The application of Perl on bioinformatics is rather famous(e.g. BioPerl). One can practise coding (esp data structures and algorithms), and learn basic bioinformatics at the same time on the site! Biology is one of my favorite subjects in high school, hope that I can grasp some time for that website.


+ Task 2 Ethiopian Multiplication

An easy and funny exercise on basic arithmetic.



+ Task 1 Count Number

A sentinel character 'E' has been used.


+ Task 2 Jump Game

A typical interview problem. It is easier to code it than to understand the task statement.



+ Task 1 Isomorphic String

We may see some power of Unicode support. Much thanks to Ben Bullock. See the link to an aftermath blogpost.


+ Task 2 Insert Interval

It is easier to understand it than to code the task statement. (I am not satisfactory with my trial and error style of problem solving during coding; still figuring out what I can help myself.)



+ Task 1 Max Points

I will choose to see how others interpret and implement the tasks first. :P


+ Task 2 Sum Path

A revisit to binary tree. I still use the array representation of a binary tree with two subroutines jumptoLc and jumptoRc (short for "jump to Left/Right child").



I would like to write some LISP codes as the guest language for some tasks as before; LISP is an interesting programming language as Perl. And, of course, write blogpost each week!

If you do not hate me, bless me that I can get a programmer internship in Hong Kong before I use up my savings... Advice or tips are welcomed.

The virus gets mutation. Stay healthy!!! □

# a debt: blog about the Sudoku code (PWC#086) which I realized it is not that great

[1] See Advent Calendar 12th December. Thanks Mohammad for accepting my submission.

Leave a comment

About C.-Y. Fung

user-pic a beginner in programming; passionate in mathematics, distance running and gender issues; from Hong Kong. https://twitter.com/e7_87