The Weekly Challenge - 165

Monday, May 16, 2022| Tags: Perl, Raku

TABLE OF CONTENTS


01. HEADLINES

02. SPONSOR

03. RECAP

04. PERL REVIEW

05. RAKU REVIEW

06. CHART

07. NEW MEMBERS

08. GUESTS

09. TASK #1: Scalable Vector Graphics (SVG)

10. TASK #2: Line of Best Fit


HEADLINES


Welcome to the Week #165.

Let us all welcome 2 new members, James Marquis and Humberto Massa to the Team PWC.

We had the pleasure to interview latest champion, Matthew Neleigh. It was great knowing him.

I would like to thank Ryan Thompson for suggesting cool tasks for the weekly challenge. Thanks Early Bird Club members for helping with task reviews.

Thanks Team PWC for reaching the milestone second time in a row i.e. 100+ regular contributions. We had 40 contributors in the Week #164.

The Week #164 seems to be special for guest contributors too. We had 14 contributors sharing solutions in 17 guest languages.

Talking about contributions, I only managed to find time for the task Prime Palindrome in Perl.

Good luck for the next challenge.


Blogs with Creative Title


1. Primarily Happy by Arne Sommer.

2. Happy Happy Joy Joy by Colin Crain.

3. Shiny Happy Numbers by Dave Jacoby.

4. Palindromic primes and moody numbers by Peter Campbell Smith.

5. Happy Palindromes by Roger Bell_West.


GitHub Repository Stats


1. Commits: 25,232 (+153)

2. Pull Requests: 6,107 (+37)

3. Contributors: 193 (+1)

4. Fork: 248 (+1)

5. Stars: 132 (+2)



Our solo sponsor Pete Sergeant has been a great support to keep us motivated. We are lucky that he agreed to continue the journey with us in the year 2022. I would like to personally thank Pete and his entire team for their generosity. It would be great if we could add few more to sponsor the prize money so that we could go back and declare weekly champions as we have done in the past. I hope and wish this will become possible in 2022. The amount doesn’t have to be huge. However, it would be nice to show off bunch of supporters. If an organisation comes forward and supports us then that would be the ultimate achievement.


RECAP


Quick recap of The Weekly Challenge - 164 by Mohammad S Anwar.


PERL REVIEW


Please check out Perl solutions review of The Weekly Challenge - 160 by Colin Crain.

If you missed any past reviews then please check out the collection.


RAKU REVIEW


If you missed any past reviews then please check out the collection.


CHART


Please take a look at the charts showing interesting data.

I would like to THANK every member of the team for their valuable suggestions. Please do share your experience with us.


NEW MEMBERS


James Marquis, an expert Perl hacker and Humberto Massa, an expert Raku hacker joined the Team PWC.

Please find out How to contribute?, if you have any doubts.

Please try the excellent tool EZPWC created by respected member Saif Ahmed of Team PWC.


GUESTS


Please checkout the guest contributions for the Week #164.

Please find past solutions by respected guests. Please share your creative solutions in other languages.


Task 1: Scalable Vector Graphics (SVG)

Submitted by: Ryan J Thompson

Scalable Vector Graphics (SVG) are not made of pixels, but lines, ellipses, and curves, that can be scaled to any size without any loss of quality. If you have ever tried to resize a small JPG or PNG, you know what I mean by “loss of quality”! What many people do not know about SVG files is, they are simply XML files, so they can easily be generated programmatically.

For this task, you may use external library, such as Perl’s SVG library, maintained in recent years by our very own Mohammad S Anwar. You can instead generate the XML yourself; it’s actually quite simple. The source for the example image for Task #2 might be instructive.

Your task is to accept a series of points and lines in the following format, one per line, in arbitrary order:

Point: x,y

Line: x1,y1,x2,y2

Example:
53,10
53,10,23,30
23,30

Then, generate an SVG file plotting all points, and all lines. If done correctly, you can view the output .svg file in your browser.


Task 2: Line of Best Fit

Submitted by: Ryan J Thompson

When you have a scatter plot of points, a line of best fit is the line that best describes the relationship between the points, and is very useful in statistics. Otherwise known as linear regression, here is an example of what such a line might look like:

Hull

The method most often used is known as the least squares method, as it is straightforward and efficient, but you may use any method that generates the correct result.

Calculate the line of best fit for the following 48 points:

333,129  39,189 140,156 292,134 393,52  160,166 362,122  13,193
341,104 320,113 109,177 203,152 343,100 225,110  23,186 282,102
284,98  205,133 297,114 292,126 339,112 327,79  253,136  61,169
128,176 346,72  316,103 124,162  65,181 159,137 212,116 337,86
215,136 153,137 390,104 100,180  76,188  77,181  69,195  92,186
275,96  250,147  34,174 213,134 186,129 189,154 361,82  363,89

Using your rudimentary graphing engine from Task #1, graph all points, as well as the line of best fit.



Last date to submit the solution 23:59 (UK Time) Sunday 22nd May 2022.


SO WHAT DO YOU THINK ?

If you have any suggestions or ideas then please do share with us.

Contact with me