diff options
| author | drbaggy <js5@sanger.ac.uk> | 2022-07-04 09:20:29 +0100 |
|---|---|---|
| committer | drbaggy <js5@sanger.ac.uk> | 2022-07-04 09:20:29 +0100 |
| commit | 9a0e9aa937cd71b048889a57f68896e5187466ac (patch) | |
| tree | fc25808aca4ca0723cc1dd9493d5faab179846a6 | |
| parent | 7bda28e12b6c4b699b181b61f2c54264a991c898 (diff) | |
| parent | 42bd07d080a38d552fb4562de9eba28ccfbecb18 (diff) | |
| download | perlweeklychallenge-club-9a0e9aa937cd71b048889a57f68896e5187466ac.tar.gz perlweeklychallenge-club-9a0e9aa937cd71b048889a57f68896e5187466ac.tar.bz2 perlweeklychallenge-club-9a0e9aa937cd71b048889a57f68896e5187466ac.zip | |
Merge remote-tracking branch 'upstream/master'
| -rw-r--r-- | challenge-171/jaldhar-h-vyas/blog.txt | 1 | ||||
| -rwxr-xr-x | challenge-171/jaldhar-h-vyas/perl/ch-1.pl | 34 | ||||
| -rwxr-xr-x | challenge-171/jaldhar-h-vyas/perl/ch-2.pl | 27 | ||||
| -rwxr-xr-x | challenge-171/jaldhar-h-vyas/raku/ch-1.raku | 24 | ||||
| -rwxr-xr-x | challenge-171/jaldhar-h-vyas/raku/ch-2.raku | 16 | ||||
| -rw-r--r-- | stats/pwc-current.json | 321 | ||||
| -rw-r--r-- | stats/pwc-language-breakdown-summary.json | 80 | ||||
| -rw-r--r-- | stats/pwc-language-breakdown.json | 2418 | ||||
| -rw-r--r-- | stats/pwc-leaders.json | 420 | ||||
| -rw-r--r-- | stats/pwc-summary-1-30.json | 50 | ||||
| -rw-r--r-- | stats/pwc-summary-121-150.json | 40 | ||||
| -rw-r--r-- | stats/pwc-summary-151-180.json | 122 | ||||
| -rw-r--r-- | stats/pwc-summary-181-210.json | 122 | ||||
| -rw-r--r-- | stats/pwc-summary-211-240.json | 126 | ||||
| -rw-r--r-- | stats/pwc-summary-241-270.json | 42 | ||||
| -rw-r--r-- | stats/pwc-summary-31-60.json | 116 | ||||
| -rw-r--r-- | stats/pwc-summary-61-90.json | 34 | ||||
| -rw-r--r-- | stats/pwc-summary-91-120.json | 86 | ||||
| -rw-r--r-- | stats/pwc-summary.json | 586 |
19 files changed, 2395 insertions, 2270 deletions
diff --git a/challenge-171/jaldhar-h-vyas/blog.txt b/challenge-171/jaldhar-h-vyas/blog.txt new file mode 100644 index 0000000000..10862e29aa --- /dev/null +++ b/challenge-171/jaldhar-h-vyas/blog.txt @@ -0,0 +1 @@ +https://www.braincells.com/perl/2022/07/perl_weekly_challenge_week_171.html
\ No newline at end of file diff --git a/challenge-171/jaldhar-h-vyas/perl/ch-1.pl b/challenge-171/jaldhar-h-vyas/perl/ch-1.pl new file mode 100755 index 0000000000..9e9b585bad --- /dev/null +++ b/challenge-171/jaldhar-h-vyas/perl/ch-1.pl @@ -0,0 +1,34 @@ +#!/usr/bin/perl +use 5.030; +use warnings; + +sub sum { + my ($arr) = @_; + my $total = 0; + + for my $elem (@{$arr}) { + $total += $elem; + } + + return $total; +} + +my @abundants; +my $n = 1; + +until (scalar @abundants == 20) { + my @divisors; + for my $i (1 .. $n / 2) { + if ($n % $i == 0) { + push @divisors, $i; + } + } + + if (sum(\@divisors) > $n) { + push @abundants, $n; + } + + $n += 2; +} + +say join q{, }, @abundants; diff --git a/challenge-171/jaldhar-h-vyas/perl/ch-2.pl b/challenge-171/jaldhar-h-vyas/perl/ch-2.pl new file mode 100755 index 0000000000..7c9ebcb2fa --- /dev/null +++ b/challenge-171/jaldhar-h-vyas/perl/ch-2.pl @@ -0,0 +1,27 @@ +#!/usr/bin/perl +use 5.030; +use warnings; + +sub compose { + my ($f, $g) = @_; + + return sub { $f->($g->(@_)); }; +} + +sub square { + my ($x) = @_; + + return $x * $x; +} + +sub sum { + my $total = 0; + + for my $elem (@_) { + $total += $elem; + } + + return $total; +} + +say compose(\&square, \&sum)->(1,2,3); diff --git a/challenge-171/jaldhar-h-vyas/raku/ch-1.raku b/challenge-171/jaldhar-h-vyas/raku/ch-1.raku new file mode 100755 index 0000000000..d1c1211034 --- /dev/null +++ b/challenge-171/jaldhar-h-vyas/raku/ch-1.raku @@ -0,0 +1,24 @@ +#!/usr/bin/raku + +sub MAIN( +) { + my @abundants; + my $n = 1; + + until @abundants.elems == 20 { + my @divisors; + for 1 .. $n / 2 -> $i { + if $n %% $i { + @divisors.push($i); + } + } + + if ([+] @divisors) > $n { + @abundants.push($n); + } + + $n += 2; + } + + @abundants.join(q{, }).say; +}
\ No newline at end of file diff --git a/challenge-171/jaldhar-h-vyas/raku/ch-2.raku b/challenge-171/jaldhar-h-vyas/raku/ch-2.raku new file mode 100755 index 0000000000..00f020410c --- /dev/null +++ b/challenge-171/jaldhar-h-vyas/raku/ch-2.raku @@ -0,0 +1,16 @@ +#!/usr/bin/raku + +sub compose(&f, &g) { + + return sub (*@args) { &f(&g(@args)); }; +} + +sub square(Int $x) { + return $x * $x; +} + +sub sum(*@args) { + return [+] @args; +} + +say compose(&square, &sum)(1,2,3); diff --git a/stats/pwc-current.json b/stats/pwc-current.json index ab42b177bb..ce3df6e026 100644 --- a/stats/pwc-current.json +++ b/stats/pwc-current.json @@ -1,9 +1,11 @@ { - "title" : { - "text" : "The Weekly Challenge - 171" + "chart" : { + "type" : "column" }, - "legend" : { - "enabled" : 0 + "yAxis" : { + "title" : { + "text" : "Total Solutions" + } }, "plotOptions" : { "series" : { @@ -14,13 +16,20 @@ "borderWidth" : 0 } }, - "chart" : { - "type" : "column" + "xAxis" : { + "type" : "category" + }, + "title" : { + "text" : "The Weekly Challenge - 171" + }, + "tooltip" : { + "headerFormat" : "<span style='font-size:11px'>{series.name}</span><br/>", + "followPointer" : 1, + "pointFormat" : "<span style='color:{point.color}'>{point.name}</span>: <b>{point.y:f}</b><br/>" }, "drilldown" : { "series" : [ { - "id" : "Adam Russell", "data" : [ [ "Perl", @@ -31,20 +40,20 @@ 2 ] ], - "name" : "Adam Russell" + "name" : "Adam Russell", + "id" : "Adam Russell" }, { + "name" : "Ali Moradi", "id" : "Ali Moradi", "data" : [ [ "Perl", 2 ] - ], - "name" : "Ali Moradi" + ] }, { - "id" : "Arne Sommer", "data" : [ [ "Raku", @@ -55,9 +64,11 @@ 1 ] ], + "id" : "Arne Sommer", "name" : "Arne Sommer" }, { + "id" : "Athanasius", "name" : "Athanasius", "data" : [ [ @@ -68,10 +79,10 @@ "Raku", 2 ] - ], - "id" : "Athanasius" + ] }, { + "id" : "Bartosz Jarzyna", "name" : "Bartosz Jarzyna", "data" : [ [ @@ -82,18 +93,17 @@ "Raku", 1 ] - ], - "id" : "Bartosz Jarzyna" + ] }, { - "id" : "Bruce Gray", "data" : [ [ "Raku", 2 ] ], - "name" : "Bruce Gray" + "name" : "Bruce Gray", + "id" : "Bruce Gray" }, { "data" : [ @@ -102,10 +112,12 @@ 2 ] ], - "id" : "Cheok-Yin Fung", - "name" : "Cheok-Yin Fung" + "name" : "Cheok-Yin Fung", + "id" : "Cheok-Yin Fung" }, { + "name" : "Colin Crain", + "id" : "Colin Crain", "data" : [ [ "Perl", @@ -115,52 +127,49 @@ "Blog", 1 ] - ], - "id" : "Colin Crain", - "name" : "Colin Crain" + ] }, { + "name" : "Dario Mazzeo", "id" : "Dario Mazzeo", "data" : [ [ "Perl", 1 ] - ], - "name" : "Dario Mazzeo" + ] }, { + "name" : "Dave Jacoby", "id" : "Dave Jacoby", "data" : [ [ "Perl", 2 ] - ], - "name" : "Dave Jacoby" + ] }, { + "id" : "Duncan C. White", "name" : "Duncan C. White", "data" : [ [ "Perl", 2 ] - ], - "id" : "Duncan C. White" + ] }, { - "name" : "E. Choroba", - "id" : "E. Choroba", "data" : [ [ "Perl", 2 ] - ] + ], + "id" : "E. Choroba", + "name" : "E. Choroba" }, { - "name" : "Flavio Poletti", "data" : [ [ "Perl", @@ -175,31 +184,48 @@ 2 ] ], + "name" : "Flavio Poletti", "id" : "Flavio Poletti" }, { - "name" : "habere-et-dispetire", "data" : [ [ "Raku", 1 ] ], + "name" : "habere-et-dispetire", "id" : "habere-et-dispetire" }, { + "id" : "Humberto Massa", "name" : "Humberto Massa", "data" : [ [ "Raku", 2 ] + ] + }, + { + "data" : [ + [ + "Perl", + 2 + ], + [ + "Raku", + 2 + ], + [ + "Blog", + 1 + ] ], - "id" : "Humberto Massa" + "name" : "Jaldhar H. Vyas", + "id" : "Jaldhar H. Vyas" }, { - "name" : "James Smith", - "id" : "James Smith", "data" : [ [ "Perl", @@ -209,7 +235,9 @@ "Blog", 1 ] - ] + ], + "name" : "James Smith", + "id" : "James Smith" }, { "data" : [ @@ -232,16 +260,18 @@ ] }, { - "name" : "Kjetil Skotheim", "data" : [ [ "Perl", 2 ] ], + "name" : "Kjetil Skotheim", "id" : "Kjetil Skotheim" }, { + "id" : "Laurent Rosenfeld", + "name" : "Laurent Rosenfeld", "data" : [ [ "Perl", @@ -255,13 +285,11 @@ "Blog", 1 ] - ], - "id" : "Laurent Rosenfeld", - "name" : "Laurent Rosenfeld" + ] }, { - "name" : "Luca Ferrari", "id" : "Luca Ferrari", + "name" : "Luca Ferrari", "data" : [ [ "Raku", @@ -274,18 +302,18 @@ ] }, { - "name" : "Mark Anderson", "data" : [ [ "Raku", 1 ] ], - "id" : "Mark Anderson" + "id" : "Mark Anderson", + "name" : "Mark Anderson" }, { - "name" : "Marton Polgar", "id" : "Marton Polgar", + "name" : "Marton Polgar", "data" : [ [ "Raku", @@ -294,37 +322,38 @@ ] }, { - "name" : "Matthew Neleigh", - "id" : "Matthew Neleigh", "data" : [ [ "Perl", 2 ] - ] + ], + "name" : "Matthew Neleigh", + "id" : "Matthew Neleigh" }, { + "name" : "Mohammad S Anwar", "id" : "Mohammad S Anwar", "data" : [ [ "Perl", 2 ] - ], - "name" : "Mohammad S Anwar" + ] }, { + "id" : "Niels van Dijke", + "name" : "Niels van Dijke", "data" : [ [ "Perl", 2 ] - ], - "id" : "Niels van Dijke", - "name" : "Niels van Dijke" + ] }, { "id" : "Peter Campbell Smith", + "name" : "Peter Campbell Smith", "data" : [ [ "Perl", @@ -334,31 +363,31 @@ "Blog", 1 ] - ], - "name" : "Peter Campbell Smith" + ] }, { - "name" : "Philippe Bricout", "data" : [ [ "Perl", 1 ] ], + "name" : "Philippe Bricout", "id" : "Philippe Bricout" }, { + "id" : "PokGoPun", "name" : "PokGoPun", "data" : [ [ "Perl", 2 ] - ], - "id" : "PokGoPun" + ] }, { "name" : "Robert DiCicco", + "id" : "Robert DiCicco", "data" : [ [ "Perl", @@ -368,8 +397,7 @@ "Raku", 1 ] - ], - "id" : "Robert DiCicco" + ] }, { "name" : "Robert Ransbottom", @@ -382,6 +410,8 @@ ] }, { + "name" : "Roger Bell_West", + "id" : "Roger Bell_West", "data" : [ [ "Perl", @@ -395,11 +425,11 @@ "Blog", 1 ] - ], - "id" : "Roger Bell_West", - "name" : "Roger Bell_West" + ] }, { + "id" : "Ryan Thompson", + "name" : "Ryan Thompson", "data" : [ [ "Perl", @@ -413,12 +443,11 @@ "Blog", 2 ] - ], - "id" : "Ryan Thompson", - "name" : "Ryan Thompson" + ] }, { "id" : "Stephen G Lynn", + "name" : "Stephen G Lynn", "data" : [ [ "Perl", @@ -432,12 +461,9 @@ "Blog", 1 ] - ], - "name" : "Stephen G Lynn" + ] }, { - "name" : "Ulrich Rieke", - "id" : "Ulrich Rieke", "data" : [ [ "Perl", @@ -447,10 +473,13 @@ "Raku", 2 ] - ] + ], + "name" : "Ulrich Rieke", + "id" : "Ulrich Rieke" }, { "id" : "W. Luis Mochan", + "name" : "W. Luis Mochan", "data" : [ [ "Perl", @@ -460,8 +489,7 @@ "Blog", 1 ] - ], - "name" : "W. Luis Mochan" + ] }, { "data" : [ @@ -475,50 +503,34 @@ } ] }, - "yAxis" : { - "title" : { - "text" : "Total Solutions" - } - }, - "subtitle" : { - "text" : "[Champions: 37] Last updated at 2022-07-04 03:42:12 GMT" - }, - "xAxis" : { - "type" : "category" - }, - "tooltip" : { - "followPointer" : 1, - "pointFormat" : "<span style='color:{point.color}'>{point.name}</span>: <b>{point.y:f}</b><br/>", - "headerFormat" : "<span style='font-size:11px'>{series.name}</span><br/>" - }, "series" : [ { "name" : "The Weekly Challenge - 171", "data" : [ { "name" : "Adam Russell", - "y" : 4, - "drilldown" : "Adam Russell" + "drilldown" : "Adam Russell", + "y" : 4 }, { + "name" : "Ali Moradi", "drilldown" : "Ali Moradi", - "y" : 2, - "name" : "Ali Moradi" + "y" : 2 }, { - "drilldown" : "Arne Sommer", "name" : "Arne Sommer", + "drilldown" : "Arne Sommer", "y" : 3 }, { - "drilldown" : "Athanasius", "name" : "Athanasius", - "y" : 4 + "y" : 4, + "drilldown" : "Athanasius" }, { - "drilldown" : "Bartosz Jarzyna", "name" : "Bartosz Jarzyna", - "y" : 3 + "y" : 3, + "drilldown" : "Bartosz Jarzyna" }, { "drilldown" : "Bruce Gray", @@ -526,69 +538,74 @@ "name" : "Bruce Gray" }, { - "y" : 2, "name" : "Cheok-Yin Fung", - "drilldown" : "Cheok-Yin Fung" + "drilldown" : "Cheok-Yin Fung", + "y" : 2 }, { - "name" : "Colin Crain", "y" : 3, - "drilldown" : "Colin Crain" + "drilldown" : "Colin Crain", + "name" : "Colin Crain" }, { - "drilldown" : "Dario Mazzeo", "name" : "Dario Mazzeo", + "drilldown" : "Dario Mazzeo", "y" : 1 }, { - "y" : 2, "name" : "Dave Jacoby", - "drilldown" : "Dave Jacoby" + "drilldown" : "Dave Jacoby", + "y" : 2 }, { - "drilldown" : "Duncan C. White", "name" : "Duncan C. White", - "y" : 2 + "y" : 2, + "drilldown" : "Duncan C. White" }, { - "y" : 2, "name" : "E. Choroba", - "drilldown" : "E. Choroba" + "drilldown" : "E. Choroba", + "y" : 2 }, { "drilldown" : "Flavio Poletti", - "name" : "Flavio Poletti", - "y" : 6 + "y" : 6, + "name" : "Flavio Poletti" }, { - "name" : "habere-et-dispetire", + "drilldown" : "habere-et-dispetire", "y" : 1, - "drilldown" : "habere-et-dispetire" + "name" : "habere-et-dispetire" }, { - "drilldown" : "Humberto Massa", "name" : "Humberto Massa", + "drilldown" : "Humberto Massa", "y" : 2 }, { - "name" : "James Smith", + "y" : 5, + "drilldown" : "Jaldhar H. Vyas", + "name" : "Jaldhar H. Vyas" + }, + { "y" : 3, - "drilldown" : "James Smith" + "drilldown" : "James Smith", + "name" : "James Smith" }, { - "drilldown" : "Jan Krnavek", "name" : "Jan Krnavek", + "drilldown" : "Jan Krnavek", "y" : 2 }, { + "name" : "Jorg Sommrey", "drilldown" : "Jorg Sommrey", - "y" : 2, - "name" : "Jorg Sommrey" + "y" : 2 }, { + "drilldown" : "Kjetil Skotheim", "y" : 2, - "name" : "Kjetil Skotheim", - "drilldown" : "Kjetil Skotheim" + "name" : "Kjetil Skotheim" }, { "name" : "Laurent Rosenfeld", @@ -597,33 +614,33 @@ }, { "y" : 8, - "name" : "Luca Ferrari", - "drilldown" : "Luca Ferrari" + "drilldown" : "Luca Ferrari", + "name" : "Luca Ferrari" }, { + "name" : "Mark Anderson", "drilldown" : "Mark Anderson", - "y" : 1, - "name" : "Mark Anderson" + "y" : 1 }, { + "y" : 2, "drilldown" : "Marton Polgar", - "name" : "Marton Polgar", - "y" : 2 + "name" : "Marton Polgar" }, { - "drilldown" : "Matthew Neleigh", "name" : "Matthew Neleigh", + "drilldown" : "Matthew Neleigh", "y" : 2 }, { - "drilldown" : "Mohammad S Anwar", "y" : 2, + "drilldown" : "Mohammad S Anwar", "name" : "Mohammad S Anwar" }, { - "name" : "Niels van Dijke", + "drilldown" : "Niels van Dijke", "y" : 2, - "drilldown" : "Niels van Dijke" + "name" : "Niels van Dijke" }, { "name" : "Peter Campbell Smith", @@ -632,18 +649,18 @@ }, { "drilldown" : "Philippe Bricout", - "name" : "Philippe Bricout", - "y" : 1 + "y" : 1, + "name" : "Philippe Bricout" }, { + "drilldown" : "PokGoPun", "y" : 2, - "name" : "PokGoPun", - "drilldown" : "PokGoPun" + "name" : "PokGoPun" }, { - "drilldown" : "Robert DiCicco", "name" : "Robert DiCicco", - "y" : 2 + "y" : 2, + "drilldown" : "Robert DiCicco" }, { "name" : "Robert Ransbottom", @@ -651,37 +668,43 @@ "drilldown" : "Robert Ransbottom" }, { - "y" : 5, "name" : "Roger Bell_West", + "y" : 5, "drilldown" : "Roger Bell_West" }, { + "name" : "Ryan Thompson", "drilldown" : "Ryan Thompson", - "y" : 6, - "name" : "Ryan Thompson" + "y" : 6 }, { "drilldown" : "Stephen G Lynn", - "name" : "Stephen G Lynn", - "y" : 5 + "y" : 5, + "name" : "Stephen G Lynn" }, { + "y" : 4, "drilldown" : "Ulrich Rieke", - "name" : "Ulrich Rieke", - "y" : 4 + "name" : "Ulrich Rieke" }, { "y" : 3, - "name" : "W. Luis Mochan", - "drilldown" : "W. Luis Mochan" + "drilldown" : "W. Luis Mochan", + "name" : "W. Luis Mochan" }, { "drilldown" : "Walt Mankowski", - "name" : "Walt Mankowski", - "y" : 2 + "y" : 2, + "name" : "Walt Mankowski" } ], "colorByPoint" : 1 } - ] + ], + "legend" : { + "enabled" : 0 + }, + "subtitle" : { + "text" : "[Champions: 38] Last updated at 2022-07-04 08:10:45 GMT" + } } diff --git a/stats/pwc-language-breakdown-summary.json b/stats/pwc-language-breakdown-summary.json index f0e266045d..97def33ff8 100644 --- a/stats/pwc-language-breakdown-summary.json +++ b/stats/pwc-language-breakdown-summary.json @@ -1,61 +1,61 @@ { + "subtitle" : { + "text" : "Last updated at 2022-07-04 08:10:45 GMT" + }, + "tooltip" : { + "pointFormat" : "<b>{point.y:.0f}</b>" + }, + "title" : { + "text" : "The Weekly Challenge Contributions [2019 - 2022]" + }, + "legend" : { + "enabled" : "false" + }, + "xAxis" : { + "type" : "category", + "labels" : { + "style" : { + "fontSize" : "13px", + "fontFamily" : "Verdana, sans-serif" + } + } + }, "series" : [ { - "dataLabels" : { - "align" : "right", - "color" : "#FFFFFF", - "enabled" : "true", - "format" : "{point.y:.0f}", - "y" : 10, - "rotation" : -90, - "style" : { - "fontSize" : "13px", - "fontFamily" : "Verdana, sans-serif" - } - }, - "name" : "Contributions", "data" : [ [ "Blog", - 2673 + 2674 ], [ "Perl", - 8347 + 8349 ], [ "Raku", - 4960 + 4962 ] - ] + ], + "dataLabels" : { + "y" : 10, + "rotation" : -90, + "format" : "{point.y:.0f}", + "enabled" : "true", + "style" : { + "fontSize" : "13px", + "fontFamily" : "Verdana, sans-serif" + }, + "color" : "#FFFFFF", + "align" : "right" + }, + "name" : "Contributions" } ], - "subtitle" : { - "text" : "Last updated at 2022-07-04 03:42:12 GMT" - }, - "xAxis" : { - "type" : "category", - "labels" : { - "style" : { - "fontFamily" : "Verdana, sans-serif", - "fontSize" : "13px" - } - } - }, - "tooltip" : { - "pointFormat" : "<b>{point.y:.0f}</b>" - }, "yAxis" : { - "min" : 0, "title" : { "text" : null - } - }, - "title" : { - "text" : "The Weekly Challenge Contributions [2019 - 2022]" - }, - "legend" : { - "enabled" : "false" + }, + "min" : 0 }, "chart" : { "type" : "column" diff --git a/stats/pwc-language-breakdown.json b/stats/pwc-language-breakdown.json index 3c8ded8ddd..1baa46e64f 100644 --- a/stats/pwc-language-breakdown.json +++ b/stats/pwc-language-breakdown.json @@ -1,883 +1,4 @@ { - "series" : [ - { - "colorByPoint" : "true", - "data" : [ - { - "name" : "#001", - "y" : 161, - "drilldown" : "001" - }, - { - "name" : "#002", - "y" : 125, - "drilldown" : "002" - }, - { - "y" : 83, - "name" : "#003", - "drilldown" : "003" - }, - { - "drilldown" : "004", - "y" : 99, - "name" : "#004" - }, - |
