diff options
| -rw-r--r-- | challenge-108/colin-crain/blog.txt | 1 | ||||
| -rw-r--r-- | challenge-108/colin-crain/perl/ch-1.pl | 19 | ||||
| -rw-r--r-- | challenge-108/colin-crain/perl/ch-2.pl | 26 | ||||
| -rw-r--r-- | challenge-108/colin-crain/python/ch-1.py | 16 | ||||
| -rw-r--r-- | challenge-108/colin-crain/python/ch-2.py | 14 | ||||
| -rw-r--r-- | challenge-108/colin-crain/raku/ch-1.raku | 10 | ||||
| -rw-r--r-- | challenge-108/colin-crain/raku/ch-2.raku | 13 | ||||
| -rw-r--r-- | stats/pwc-current.json | 333 | ||||
| -rw-r--r-- | stats/pwc-language-breakdown-summary.json | 74 | ||||
| -rw-r--r-- | stats/pwc-language-breakdown.json | 720 | ||||
| -rw-r--r-- | stats/pwc-leaders.json | 400 | ||||
| -rw-r--r-- | stats/pwc-summary-1-30.json | 52 | ||||
| -rw-r--r-- | stats/pwc-summary-121-150.json | 46 | ||||
| -rw-r--r-- | stats/pwc-summary-151-180.json | 110 | ||||
| -rw-r--r-- | stats/pwc-summary-181-210.json | 110 | ||||
| -rw-r--r-- | stats/pwc-summary-211-240.json | 30 | ||||
| -rw-r--r-- | stats/pwc-summary-31-60.json | 96 | ||||
| -rw-r--r-- | stats/pwc-summary-61-90.json | 30 | ||||
| -rw-r--r-- | stats/pwc-summary-91-120.json | 56 | ||||
| -rw-r--r-- | stats/pwc-summary.json | 500 |
20 files changed, 1389 insertions, 1267 deletions
diff --git a/challenge-108/colin-crain/blog.txt b/challenge-108/colin-crain/blog.txt new file mode 100644 index 0000000000..0b7df15df7 --- /dev/null +++ b/challenge-108/colin-crain/blog.txt @@ -0,0 +1 @@ +https://colincrain.com/2021/04/16/partitions-in-memories-a-triangular-palace/ diff --git a/challenge-108/colin-crain/perl/ch-1.pl b/challenge-108/colin-crain/perl/ch-1.pl new file mode 100644 index 0000000000..15515e99db --- /dev/null +++ b/challenge-108/colin-crain/perl/ch-1.pl @@ -0,0 +1,19 @@ +use warnings; +use strict; +use feature ":5.26"; +use feature qw(signatures); +no warnings 'experimental::signatures'; +use Devel::Peek qw(Dump); + + +my $foo = "this is a string"; +my $foo_ref = \$foo; +$foo_ref =~ m/(SCALAR|ARRAY|HASH)\((.*)\)/; + +say "The variable head is stored at $2"; +my $det = $1 eq 'ARRAY' ? 'an' : 'a'; +say "The variable is $det \L$1"; +say "-" x 25; +say ''; + +Dump $foo; diff --git a/challenge-108/colin-crain/perl/ch-2.pl b/challenge-108/colin-crain/perl/ch-2.pl new file mode 100644 index 0000000000..9664a9c1ee --- /dev/null +++ b/challenge-108/colin-crain/perl/ch-2.pl @@ -0,0 +1,26 @@ +use warnings; +use strict; +use feature ":5.26"; +use feature qw(signatures); +no warnings 'experimental::signatures'; +use bigint; + + +my $triangle; +my $values = 100; +$triangle->[0] = [1]; + +for my $row ( 1..$values ) { + ## the first value + $triangle->[$row][0] = $triangle->[$row-1][-1]; + + ## the rest of the row + for my $i (1..$row) { + $triangle->[$row][$i] = + $triangle->[$row-1][$i-1] + $triangle->[$row][$i-1]; + } +} + +for my $n (0..$values) { + printf "%10s %-s\n", "B($n)", $triangle->[$n][0]; +} diff --git a/challenge-108/colin-crain/python/ch-1.py b/challenge-108/colin-crain/python/ch-1.py new file mode 100644 index 0000000000..9d0e760eb7 --- /dev/null +++ b/challenge-108/colin-crain/python/ch-1.py @@ -0,0 +1,16 @@ +foo = 42 +loc_foo = hex(id(foo)) + +print( "the variable 'foo' is located at:", loc_foo ) + +bar = 42 +loc_bar = hex(id(bar)) + +print( "the variable 'bar' is located at:", loc_bar ) +print( "bar equals foo :", bar == foo ) +print( "bar is the same object as foo :", bar is foo) + +if loc_foo == loc_bar: + print( "the value", foo, "is interned") +else: + print( "the value", foo, "is not interned") diff --git a/challenge-108/colin-crain/python/ch-2.py b/challenge-108/colin-crain/python/ch-2.py new file mode 100644 index 0000000000..0134e5723d --- /dev/null +++ b/challenge-108/colin-crain/python/ch-2.py @@ -0,0 +1,14 @@ +values = 10 +tri = [[0 for x in range(x+1)] for x in range(values)] + +tri[0][0] = 1 + +for row in range(1,len(tri)): + tri[row][0] = tri[row-1][-1] + for i in range(1,row+1): + tri[row][i] = tri[row][i-1] + tri[row-1][i-1] + +for row in tri: + for elem in row: + print(elem, end=" ") + print() diff --git a/challenge-108/colin-crain/raku/ch-1.raku b/challenge-108/colin-crain/raku/ch-1.raku new file mode 100644 index 0000000000..e4ad12821a --- /dev/null +++ b/challenge-108/colin-crain/raku/ch-1.raku @@ -0,0 +1,10 @@ +unit sub MAIN () ; + +my $foo = 42; + +say $foo; +say $foo.WHERE.base(16); + +my $bar = $foo; +say "they're the same of course" if $bar.WHERE == $foo.WHERE; + diff --git a/challenge-108/colin-crain/raku/ch-2.raku b/challenge-108/colin-crain/raku/ch-2.raku new file mode 100644 index 0000000000..a4f3069840 --- /dev/null +++ b/challenge-108/colin-crain/raku/ch-2.raku @@ -0,0 +1,13 @@ +unit sub MAIN ($values = 100) ; + +my @triangle; +@triangle[0] = [1]; + +for 1..$values -> $row { + @triangle[$row][0] = @triangle[$row-1][*-1]; + for 1..$row -> $i { + @triangle[$row][$i] = @triangle[$row][$i-1] + @triangle[$row-1][$i-1]; + } +} + +say $_[0] for @triangle; diff --git a/stats/pwc-current.json b/stats/pwc-current.json index cac8b208f8..1eae34aee8 100644 --- a/stats/pwc-current.json +++ b/stats/pwc-current.json @@ -1,6 +1,123 @@ { - "subtitle" : { - "text" : "[Champions: 17] Last updated at 2021-04-16 04:43:54 GMT" + "chart" : { + "type" : "column" + }, + "yAxis" : { + "title" : { + "text" : "Total Solutions" + } + }, + "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/>" + }, + "series" : [ + { + "colorByPoint" : 1, + "data" : [ + { + "name" : "Aaron Smith", + "y" : 3, + "drilldown" : "Aaron Smith" + }, + { + "name" : "Cheok-Yin Fung", + "y" : 1, + "drilldown" : "Cheok-Yin Fung" + }, + { + "y" : 5, + "name" : "Colin Crain", + "drilldown" : "Colin Crain" + }, + { + "drilldown" : "Daniel Bowling", + "name" : "Daniel Bowling", + "y" : 2 + }, + { + "name" : "Dave Jacoby", + "y" : 3, + "drilldown" : "Dave Jacoby" + }, + { + "y" : 2, + "name" : "E. Choroba", + "drilldown" : "E. Choroba" + }, + { + "name" : "Jan Krnavek", + "y" : 2, + "drilldown" : "Jan Krnavek" + }, + { + "y" : 2, + "name" : "Jorg Sommrey", + "drilldown" : "Jorg Sommrey" + }, + { + "name" : "Laurent Rosenfeld", + "y" : 5, + "drilldown" : "Laurent Rosenfeld" + }, + { + "drilldown" : "Luca Ferrari", + "y" : 4, + "name" : "Luca Ferrari" + }, + { + "y" : 2, + "name" : "Mark Anderson", + "drilldown" : "Mark Anderson" + }, + { + "y" : 3, + "name" : "Mohammad S Anwar", + "drilldown" : "Mohammad S Anwar" + }, + { + "y" : 2, + "name" : "Niels van Dijke", + "drilldown" : "Niels van Dijke" + }, + { + "drilldown" : "Roger Bell_West", + "y" : 5, + "name" : "Roger Bell_West" + }, + { + "drilldown" : "Simon Proctor", + "name" : "Simon Proctor", + "y" : 1 + }, + { + "name" : "Stuart Little", + "y" : 4, + "drilldown" : "Stuart Little" + }, + { + "drilldown" : "Ulrich Rieke", + "name" : "Ulrich Rieke", + "y" : 4 + }, + { + "drilldown" : "W. Luis Mochan", + "name" : "W. Luis Mochan", + "y" : 3 + } + ], + "name" : "Perl Weekly Challenge - 108" + } + ], + "plotOptions" : { + "series" : { + "borderWidth" : 0, + "dataLabels" : { + "enabled" : 1, + "format" : "{point.y}" + } + } }, "drilldown" : { "series" : [ @@ -19,36 +136,40 @@ "id" : "Aaron Smith" }, { - "name" : "Cheok-Yin Fung", - "id" : "Cheok-Yin Fung", "data" : [ [ "Perl", 1 ] - ] + ], + "name" : "Cheok-Yin Fung", + "id" : "Cheok-Yin Fung" }, { "data" : [ [ + "Perl", + 2 + ], + [ "Raku", - 1 + 2 ], [ "Blog", 1 ] ], - "name" : "Daniel Bowling", - "id" : "Daniel Bowling" + "name" : "Colin Crain", + "id" : "Colin Crain" }, { - "id" : "Dave Jacoby", - "name" : "Dave Jacoby", + "name" : "Daniel Bowling", + "id" : "Daniel Bowling", "data" : [ [ - "Perl", - 2 + "Raku", + 1 ], [ "Blog", @@ -61,10 +182,24 @@ [ "Perl", 2 + ], + [ + "Blog", + 1 ] ], + "name" : "Dave Jacoby", + "id" : "Dave Jacoby" + }, + { "name" : "E. Choroba", - "id" : "E. Choroba" + "id" : "E. Choroba", + "data" : [ + [ + "Perl", + 2 + ] + ] }, { "data" : [ @@ -73,8 +208,8 @@ 2 ] ], - "name" : "Jan Krnavek", - "id" : "Jan Krnavek" + "id" : "Jan Krnavek", + "name" : "Jan Krnavek" }, { "data" : [ @@ -87,8 +222,6 @@ "id" : "Jorg Sommrey" }, { - "id" : "Laurent Rosenfeld", - "name" : "Laurent Rosenfeld", "data" : [ [ "Perl", @@ -102,11 +235,11 @@ "Blog", 1 ] - ] + ], + "id" : "Laurent Rosenfeld", + "name" : "Laurent Rosenfeld" }, { - "name" : "Luca Ferrari", - "id" : "Luca Ferrari", "data" : [ [ "Raku", @@ -116,17 +249,19 @@ "Blog", 2 ] - ] + ], + "name" : "Luca Ferrari", + "id" : "Luca Ferrari" }, { + "id" : "Mark Anderson", + "name" : "Mark Anderson", "data" : [ [ "Raku", 2 ] - ], - "name" : "Mark Anderson", - "id" : "Mark Anderson" + ] }, { "data" : [ @@ -143,16 +278,18 @@ "name" : "Mohammad S Anwar" }, { + "id" : "Niels van Dijke", + "name" : "Niels van Dijke", "data" : [ [ "Perl", 2 ] - ], - "id" : "Niels van Dijke", - "name" : "Niels van Dijke" + ] }, { + "name" : "Roger Bell_West", + "id" : "Roger Bell_West", "data" : [ [ "Perl", @@ -166,9 +303,7 @@ "Blog", 1 ] - ], - "name" : "Roger Bell_West", - "id" : "Roger Bell_West" + ] }, { "data" : [ @@ -181,6 +316,8 @@ "id" : "Simon Proctor" }, { + "id" : "Stuart Little", + "name" : "Stuart Little", "data" : [ [ "Perl", @@ -190,13 +327,9 @@ "Raku", 2 ] - ], - "id" : "Stuart Little", - "name" : "Stuart Little" + ] }, { - "id" : "Ulrich Rieke", - "name" : "Ulrich Rieke", "data" : [ [ "Perl", @@ -206,9 +339,13 @@ "Raku", 2 ] - ] + ], + "name" : "Ulrich Rieke", + "id" : "Ulrich Rieke" }, { + "id" : "W. Luis Mochan", + "name" : "W. Luis Mochan", "data" : [ [ "Perl", @@ -218,134 +355,20 @@ "Blog", 1 ] - ], - "id" : "W. Luis Mochan", - "name" : "W. Luis Mochan" + ] } ] }, - "xAxis" : { - "type" : "category" - }, - "tooltip" : { - "headerFormat" : "<span style='font-size:11px'>{series.name}</span><br/>", - "pointFormat" : "<span style='color:{point.color}'>{point.name}</span>: <b>{point.y:f}</b><br/>", - "followPointer" : 1 + "subtitle" : { + "text" : "[Champions: 18] Last updated at 2021-04-16 05:01:37 GMT" }, "legend" : { "enabled" : 0 }, - "series" : [ - { - "name" : "Perl Weekly Challenge - 108", - "data" : [ - { - "y" : 3, - "name" : "Aaron Smith", - "drilldown" : "Aaron Smith" - }, - { - "y" : 1, - "name" : "Cheok-Yin Fung", - "drilldown" : "Cheok-Yin Fung" - }, - { - "drilldown" : "Daniel Bowling", - "y" : 2, - "name" : "Daniel Bowling" - }, - { - "drilldown" : "Dave Jacoby", - "y" : 3, - "name" : "Dave Jacoby" - }, - { - "drilldown" : "E. Choroba", - "y" : 2, - "name" : "E. Choroba" - }, - { - "name" : "Jan Krnavek", - "y" : 2, - "drilldown" : "Jan Krnavek" - }, - { - "y" : 2, - "name" : "Jorg Sommrey", - "drilldown" : "Jorg Sommrey" - }, - { - "name" : "Laurent Rosenfeld", - "y" : 5, - "drilldown" : "Laurent Rosenfeld" - }, - { - "name" : "Luca Ferrari", - "y" : 4, - "drilldown" : "Luca Ferrari" - }, - { - "drilldown" : "Mark Anderson", - "y" : 2, - "name" : "Mark Anderson" - }, - { - "name" : "Mohammad S Anwar", - "y" : 3, - "drilldown" : "Mohammad S Anwar" - }, - { - "drilldown" : "Niels van Dijke", - "name" : "Niels van Dijke", - "y" : 2 - }, - { - "drilldown" : "Roger Bell_West", - "name" : "Roger Bell_West", - "y" : 5 - }, - { - "y" : 1, - "name" : "Simon Proctor", - "drilldown" : "Simon Proctor" - }, - { - "drilldown" : "Stuart Little", - "y" : 4, - "name" : "Stuart Little" - }, - { - "drilldown" : "Ulrich Rieke", - "name" : "Ulrich Rieke", - "y" : 4 - }, - { - "drilldown" : "W. Luis Mochan", - "name" : "W. Luis Mochan", - "y" : 3 - } - ], - "colorByPoint" : 1 - } - ], - "yAxis" : { - "title" : { - "text" : "Total Solutions" - } + "xAxis" : { + "type" : "category" }, "title" : { "text" : "Perl Weekly Challenge - 108" - }, - "chart" : { - "type" : "column" - }, - "plotOptions" : { - "series" : { - "borderWidth" : 0, - "dataLabels" : { - "format" : "{point.y}", - "enabled" : 1 - } - } } } diff --git a/stats/pwc-language-breakdown-summary.json b/stats/pwc-language-breakdown-summary.json index 345506d588..85bfc3493c 100644 --- a/stats/pwc-language-breakdown-summary.json +++ b/stats/pwc-language-breakdown-summary.json @@ -1,63 +1,63 @@ { + "subtitle" : { + "text" : "Last updated at 2021-04-16 05:01:37 GMT" + }, "xAxis" : { + "type" : "category", "labels" : { "style" : { "fontFamily" : "Verdana, sans-serif", "fontSize" : "13px" } - }, - "type" : "category" + } }, "legend" : { "enabled" : "false" }, + "title" : { + "text" : "Perl Weekly Challenge Contributions [2019 - 2020]" + }, + "chart" : { + "type" : "column" + }, + "yAxis" : { + "title" : { + "text" : null + }, + "min" : 0 + }, + "tooltip" : { + "pointFormat" : "<b>{point.y:.0f}</b>" + }, "series" : [ { - "dataLabels" : { - "color" : "#FFFFFF", - "rotation" : -90, - "enabled" : "true", - "format" : "{point.y:.0f}", - "style" : { - "fontSize" : "13px", - "fontFamily" : "Verdana, sans-serif" - }, - "align" : "right", - "y" : 10 - }, + "name" : "Contributions", "data" : [ [ "Blog", - 1471 + 1472 ], [ "Perl", - 5074 + 5076 ], [ "Raku", - 3236 + 3238 ] ], - "name" : "Contributions" - } - ], - "tooltip" : { - "pointFormat" : "<b>{point.y:.0f}</b>" - }, - "subtitle" : { - "text" : "Last updated at 2021-04-16 04:43:54 GMT" - }, - "yAxis" : { - "min" : 0, - "title" : { - "text" : null + "dataLabels" : { + "align" : "right", + "y" : 10, + "style" : { + "fontSize" : "13px", + "fontFamily" : "Verdana, sans-serif" + }, + "format" : "{point.y:.0f}", + "rotation" : -90, + "enabled" : "true", + "color" : "#FFFFFF" + } } - }, - "chart" : { - "type" : "column" - }, - "title" : { - "text" : "Perl Weekly Challenge Contributions [2019 - 2020]" - } + ] } diff --git a/stats/pwc-language-breakdown.json b/stats/pwc-language-breakdown.json index 4ef9b6d9f3..45ec79eea4 100644 --- a/stats/pwc-language-breakdown.json +++ b/stats/pwc-language-breakdown.json @@ -1,7 +1,27 @@ { + "legend" : { + "enabled" : "false" + }, + "xAxis" : { + "type" : "category" + }, + "title" : { + "text" : "Perl Weekly Challenge Language" + }, + "plotOptions" : { + "series" : { + "dataLabels" : { + "enabled" : 1, + "format" : "{point.y}" + }, + "borderWidth" : 0 + } + }, "drilldown" : { "series" : [ { + "id" : "001", + "name" : "001", "data" : [ [ "Perl", @@ -15,11 +35,11 @@ "Blog", 11 ] - ], - "id" : "001", - "name" : "001" + ] }, { + "id" : "002", + "name" : "002", "data" : [ [ "Perl", @@ -33,9 +53,7 @@ "Blog", 10 ] - ], - "name" : "002", - "id" : "002" + ] }, { "data" : [ @@ -52,12 +70,10 @@ 9 ] ], - "name" : "003", - "id" : "003" + "id" : "003", + "name" : "003" }, { - "id" : "004", - "name" : "004", "data" : [ [ "Perl", @@ -71,11 +87,13 @@ "Blog", 10 ] - ] + ], + "id" : "004", + "name" : "004" }, { - "id" : "005", "name" : "005", + "id" : "005", "data" : [ [ "Perl", @@ -92,8 +110,8 @@ ] }, { - "name" : "006", "id" : "006", + "name" : "006", "data" : [ [ "Perl", @@ -110,8 +128,8 @@ ] }, { - "name" : "007", "id" : "007", + "name" : "007", "data" : [ [ "Perl", @@ -146,6 +164,8 @@ "id" : "008" }, { + "id" : "009", + "name" : "009", "data" : [ [ "Perl", @@ -159,11 +179,11 @@ "Blog", 13 ] - ], - "name" : "009", - "id" : "009" + ] }, { + "id" : "010", + "name" : "010", "data" : [ [ "Perl", @@ -177,13 +197,11 @@ "Blog", 11 ] - ], - "name" : "010", - "id" : "010" + ] }, { - "id" : "011", "name" : "011", + "id" : "011", "data" : [ [ "Perl", @@ -200,6 +218,8 @@ ] }, { + "name" : "012", + "id" : "012", "data" : [ [ "Perl", @@ -213,9 +233,7 @@ "Blog", 11 ] - ], - "name" : "012", - "id" : "012" + ] }, { "id" : "013", @@ -236,8 +254,6 @@ ] }, { - "name" : "014", - "id" : "014", "data" : [ [ "Perl", @@ -251,11 +267,11 @@ "Blog", 15 ] - ] + ], + "id" : "014", + "name" : "014" }, { - "id" : "015", - "name" : "015", "data" : [ [ "Perl", @@ -269,7 +285,9 @@ "Blog", 15 ] - ] + ], + "id" : "015", + "name" : "015" }, { "name" : "016", @@ -308,8 +326,8 @@ "name" : "017" }, { - "id" : "018", "name" : "018", + "id" : "018", "data" : [ [ "Perl", @@ -326,8 +344,6 @@ ] }, { - "name" : "019", - "id" : "019", "data" : [ [ "Perl", @@ -341,7 +357,9 @@ "Blog", 13 ] - ] + ], + "id" : "019", + "name" : "019" }, { "name" : "020", @@ -362,8 +380,6 @@ ] }, { - "id" : "021", - "name" : "021", "data" : [ [ "Perl", @@ -377,7 +393,9 @@ "Blog", 10 ] - ] + ], + "id" : "021", + "name" : "021" }, { "id" : "022", @@ -398,8 +416,8 @@ ] }, { - "name" : "023", "id" : "023", + "name" : "023", "data" : [ [ "Perl", @@ -416,8 +434,6 @@ ] }, { - "name" : "024", - "id" : "024", "data" : [ [ "Perl", @@ -431,11 +447,13 @@ "Blog", 11 ] - ] + ], + "id" : "024", + "name" : "024" }, { - "id" : "025", "name" : "025", + "id" : "025", "data" : [ [ "Perl", @@ -452,6 +470,8 @@ ] }, { + "id" : "026", + "name" : "026", "data" : [ [ "Perl", @@ -465,11 +485,11 @@ "Blog", 10 ] - ], - "name" : "026", - "id" : "026" + ] }, { + "name" : "027", + "id" : "027", "data" : [ [ "Perl", @@ -483,13 +503,11 @@ "Blog", 9 ] - ], - "id" : "027", - "name" : "027" + ] }, { - "id" : "028", "name" : "028", + "id" : "028", "data" : [ [ "Perl", @@ -538,10 +556,12 @@ 10 ] ], - "name" : "030", - "id" : "030" + "id" : "030", + "name" : "030" }, { + "id" : "031", + "name" : "031", "data" : [ [ "Perl", @@ -555,13 +575,9 @@ "Blog", 9 ] - ], - "id" : "031", - "name" : "031" + ] }, { - "id" : "032", - "name" : "032", "data" : [ [ "Perl", @@ -575,7 +591,9 @@ "Blog", 10 ] - ] + ], + "id" : "032", + "name" : "032" }, { "data" : [ @@ -614,8 +632,6 @@ "name" : "034" }, { |
