diff options
| author | Mohammad S Anwar <mohammad.anwar@yahoo.com> | 2021-04-18 17:33:23 +0100 |
|---|---|---|
| committer | Mohammad S Anwar <mohammad.anwar@yahoo.com> | 2021-04-18 17:33:23 +0100 |
| commit | b3a6a19d50188ae25bb7e8253425c00d2888442e (patch) | |
| tree | 9e68ba39071c19ee28171011faabbb8f2c54038e | |
| parent | 89f97c40ce96e6436d438e9501aad08b3b927337 (diff) | |
| download | perlweeklychallenge-club-b3a6a19d50188ae25bb7e8253425c00d2888442e.tar.gz perlweeklychallenge-club-b3a6a19d50188ae25bb7e8253425c00d2888442e.tar.bz2 perlweeklychallenge-club-b3a6a19d50188ae25bb7e8253425c00d2888442e.zip | |
- Added solutions by Pete Houston.
| -rw-r--r-- | challenge-108/pete-houston/c/ch-1.c | 23 | ||||
| -rw-r--r-- | challenge-108/pete-houston/fortran/ch-1.f95 | 18 | ||||
| -rw-r--r-- | challenge-108/pete-houston/perl/ch-1.pl | 21 | ||||
| -rw-r--r-- | challenge-108/pete-houston/perl/ch-2.pl | 30 | ||||
| -rw-r--r-- | challenge-108/pete-houston/python/ch-1.py | 16 | ||||
| -rw-r--r-- | stats/pwc-current.json | 395 | ||||
| -rw-r--r-- | stats/pwc-language-breakdown-summary.json | 62 | ||||
| -rw-r--r-- | stats/pwc-language-breakdown.json | 804 | ||||
| -rw-r--r-- | stats/pwc-leaders.json | 750 | ||||
| -rw-r--r-- | stats/pwc-summary-1-30.json | 46 | ||||
| -rw-r--r-- | stats/pwc-summary-121-150.json | 44 | ||||
| -rw-r--r-- | stats/pwc-summary-151-180.json | 110 | ||||
| -rw-r--r-- | stats/pwc-summary-181-210.json | 104 | ||||
| -rw-r--r-- | stats/pwc-summary-211-240.json | 58 | ||||
| -rw-r--r-- | stats/pwc-summary-31-60.json | 100 | ||||
| -rw-r--r-- | stats/pwc-summary-61-90.json | 30 | ||||
| -rw-r--r-- | stats/pwc-summary-91-120.json | 94 | ||||
| -rw-r--r-- | stats/pwc-summary.json | 34 |
18 files changed, 1431 insertions, 1308 deletions
diff --git a/challenge-108/pete-houston/c/ch-1.c b/challenge-108/pete-houston/c/ch-1.c new file mode 100644 index 0000000000..0a1ad186c9 --- /dev/null +++ b/challenge-108/pete-houston/c/ch-1.c @@ -0,0 +1,23 @@ +/*
+===============================================================================
+
+ FILE: 10801.c
+
+ USAGE: gcc 10801.c && a.out
+
+ DESCRIPTION: Store a scalar and print the memory address of it
+
+ AUTHOR: Pete Houston (pete), cpan@openstrike.co.uk
+ ORGANIZATION: Openstrike
+ VERSION: 1.0
+ CREATED: 16/04/21
+===============================================================================
+*/
+
+#include <stdio.h>
+
+int main () {
+ int i = 5;
+ printf ("i is stored at address 0x%x\n", &i);
+ return (0);
+}
diff --git a/challenge-108/pete-houston/fortran/ch-1.f95 b/challenge-108/pete-houston/fortran/ch-1.f95 new file mode 100644 index 0000000000..8869ee3351 --- /dev/null +++ b/challenge-108/pete-houston/fortran/ch-1.f95 @@ -0,0 +1,18 @@ +PROGRAM address
+!===============================================================================
+!
+! FILE: 10801.f95
+!
+! USAGE: f95 10801.f95 && ./a.out
+!
+! DESCRIPTION: Store a scalar and print the memory address of it
+!
+! AUTHOR: Pete Houston (pete), cpan@openstrike.co.uk
+! ORGANIZATION: Openstrike
+! VERSION: 1.0
+! CREATED: 16/04/21
+!===============================================================================
+IMPLICIT NONE
+INTEGER :: I = 5
+PRINT ('("I is at address 0x", Z8.8)'), LOC(I)
+END PROGRAM address
diff --git a/challenge-108/pete-houston/perl/ch-1.pl b/challenge-108/pete-houston/perl/ch-1.pl new file mode 100644 index 0000000000..e16acca784 --- /dev/null +++ b/challenge-108/pete-houston/perl/ch-1.pl @@ -0,0 +1,21 @@ +#!/usr/bin/env perl +#=============================================================================== +# +# FILE: 10801.pl +# +# USAGE: ./10801.pl +# +# DESCRIPTION: Store a scalar and print the memory address of it +# +# AUTHOR: Pete Houston (pete), cpan@openstrike.co.uk +# ORGANIZATION: Openstrike +# VERSION: 1.0 +# CREATED: 12/04/21 +#=============================================================================== + +use strict; +use warnings; + +my $scalar = 'foo'; +my ($addr) = \$scalar =~ /(0x\w+)/; +print "\$scalar is at memory address $addr\n"; diff --git a/challenge-108/pete-houston/perl/ch-2.pl b/challenge-108/pete-houston/perl/ch-2.pl new file mode 100644 index 0000000000..0ab6c438f1 --- /dev/null +++ b/challenge-108/pete-houston/perl/ch-2.pl @@ -0,0 +1,30 @@ +#!/usr/bin/env perl +#=============================================================================== +# +# FILE: 10802.pl +# +# USAGE: ./10802.pl +# +# DESCRIPTION: Bell numbers 0 to 9 via triangle method +# https://en.wikipedia.org/wiki/Bell_triangle +# +# AUTHOR: Pete Houston (pete), cpan@openstrike.co.uk +# ORGANIZATION: Openstrike +# VERSION: 1.0 +# CREATED: 12/04/21 +#=============================================================================== + +use strict; +use warnings; + +my $max = 9; +my @t = ([1]); +for my $x (1 .. $max) { + my @row = ($t[$x-1]->[-1]); + for my $i (1 .. $x) { + push @row, $row[-1] + $t[$x-1]->[$i-1]; + } + push @t, [@row]; +} + +print "B_$_ = $t[$_]->[-1]\n" for 0 .. $max; diff --git a/challenge-108/pete-houston/python/ch-1.py b/challenge-108/pete-houston/python/ch-1.py new file mode 100644 index 0000000000..fcca2dc163 --- /dev/null +++ b/challenge-108/pete-houston/python/ch-1.py @@ -0,0 +1,16 @@ +#!/usr/bin/python
+#===============================================================================
+#
+# FILE: 10801.py
+#
+# USAGE: ./10801.py
+#
+# DESCRIPTION: Store a scalar and print the memory address of it
+#
+# AUTHOR: Pete Houston (pete), cpan@openstrike.co.uk
+# ORGANIZATION: Openstrike
+# VERSION: 1.0
+# CREATED: 18/04/21
+#===============================================================================
+i = 5
+print ('i is stored at address ' + str (hex (id (i))))
diff --git a/stats/pwc-current.json b/stats/pwc-current.json index 45fa5a1f34..9fa460a2c2 100644 --- a/stats/pwc-current.json +++ b/stats/pwc-current.json @@ -1,8 +1,161 @@ { + "subtitle" : { + "text" : "[Champions: 23] Last updated at 2021-04-18 16:30:51 GMT" + }, + "xAxis" : { + "type" : "category" + }, + "series" : [ + { + "name" : "Perl Weekly Challenge - 108", + "colorByPoint" : 1, + "data" : [ + { + "y" : 3, + "drilldown" : "Aaron Smith", + "name" : "Aaron Smith" + }, + { + "name" : "Athanasius", + "drilldown" : "Athanasius", + "y" : 3 + }, + { + "drilldown" : "Cheok-Yin Fung", + "y" : 1, + "name" : "Cheok-Yin Fung" + }, + { + "name" : "Colin Crain", + "y" : 5, + "drilldown" : "Colin Crain" + }, + { + "name" : "Daniel Bowling", + "y" : 2, + "drilldown" : "Daniel Bowling" + }, + { + "name" : "Dave Jacoby", + "drilldown" : "Dave Jacoby", + "y" : 3 + }, + { + "y" : 2, + "drilldown" : "E. Choroba", + "name" : "E. Choroba" + }, + { + "drilldown" : "James Smith", + "y" : 2, + "name" : "James Smith" + }, + { + "name" : "Jan Krnavek", + "y" : 2, + "drilldown" : "Jan Krnavek" + }, + { + "name" : "Jorg Sommrey", + "drilldown" : "Jorg Sommrey", + "y" : 2 + }, + { + "name" : "Laurent Rosenfeld", + "y" : 5, + "drilldown" : "Laurent Rosenfeld" + }, + { + "name" : "Luca Ferrari", + "y" : 4, + "drilldown" : "Luca Ferrari" + }, + { + "y" : 2, + "drilldown" : "Mark Anderson", + "name" : "Mark Anderson" + }, + { + "name" : "Mohammad S Anwar", + "y" : 3, + "drilldown" : "Mohammad S Anwar" + }, + { + "y" : 2, + "drilldown" : "Niels van Dijke", + "name" : "Niels van Dijke" + }, + { + "name" : "Pete Houston", + "drilldown" : "Pete Houston", + "y" : 2 + }, + { + "y" : 5, + "drilldown" : "Roger Bell_West", + "name" : "Roger Bell_West" + }, + { + "name" : "Simon Green", + "drilldown" : "Simon Green", + "y" : 3 + }, + { + "name" : "Simon Proctor", + "y" : 1, + "drilldown" : "Simon Proctor" + }, + { + "name" : "Stuart Little", + "y" : 4, + "drilldown" : "Stuart Little" + }, + { + "drilldown" : "Ulrich Rieke", + "y" : 4, + "name" : "Ulrich Rieke" + }, + { + "drilldown" : "W. Luis Mochan", + "y" : 3, + "name" : "W. Luis Mochan" + }, + { + "drilldown" : "Wanderdoc", + "y" : 2, + "name" : "Wanderdoc" + } + ] + } + ], + "chart" : { + "type" : "column" + }, + "yAxis" : { + "title" : { + "text" : "Total Solutions" + } + }, + "legend" : { + "enabled" : 0 + }, + "plotOptions" : { + "series" : { + "dataLabels" : { + "format" : "{point.y}", + "enabled" : 1 + }, + "borderWidth" : 0 + } + }, + "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/>" + }, "drilldown" : { "series" : [ { - "name" : "Aaron Smith", "id" : "Aaron Smith", "data" : [ [ @@ -13,11 +166,12 @@ "Blog", 1 ] - ] + ], + "name" : "Aaron Smith" }, { - "id" : "Athanasius", "name" : "Athanasius", + "id" : "Athanasius", "data" : [ [ "Perl", @@ -30,14 +184,14 @@ ] }, { - "name" : "Cheok-Yin Fung", "id" : "Cheok-Yin Fung", "data" : [ [ "Perl", 1 ] - ] + ], + "name" : "Cheok-Yin Fung" }, { "data" : [ @@ -54,10 +208,12 @@ 1 ] ], - "name" : "Colin Crain", - "id" : "Colin Crain" + "id" : "Colin Crain", + "name" : "Colin Crain" }, { + "name" : "Daniel Bowling", + "id" : "Daniel Bowling", "data" : [ [ "Raku", @@ -67,13 +223,9 @@ "Blog", 1 ] - ], - "id" : "Daniel Bowling", - "name" : "Daniel Bowling" + ] }, { - "id" : "Dave Jacoby", - "name" : "Dave Jacoby", "data" : [ [ "Perl", @@ -83,17 +235,19 @@ "Blog", 1 ] - ] + ], + "id" : "Dave Jacoby", + "name" : "Dave Jacoby" }, { - "id" : "E. Choroba", - "name" : "E. Choroba", "data" : [ [ "Perl", 2 ] - ] + ], + "id" : "E. Choroba", + "name" : "E. Choroba" }, { "data" : [ @@ -106,28 +260,27 @@ "name" : "James Smith" }, { - "name" : "Jan Krnavek", - "id" : "Jan Krnavek", "data" : [ [ "Raku", 2 ] - ] + ], + "id" : "Jan Krnavek", + "name" : "Jan Krnavek" }, { "name" : "Jorg Sommrey", - "id" : "Jorg Sommrey", "data" : [ [ "Perl", 2 ] - ] + ], + "id" : "Jorg Sommrey" }, { "name" : "Laurent Rosenfeld", - "id" : "Laurent Rosenfeld", "data" : [ [ "Perl", @@ -141,11 +294,11 @@ "Blog", 1 ] - ] + ], + "id" : "Laurent Rosenfeld" }, { "name" : "Luca Ferrari", - "id" : "Luca Ferrari", "data" : [ [ "Raku", @@ -155,19 +308,21 @@ "Blog", 2 ] - ] + ], + "id" : "Luca Ferrari" }, { - "id" : "Mark Anderson", "name" : "Mark Anderson", "data" : [ [ "Raku", 2 ] - ] + ], + "id" : "Mark Anderson" }, { + "name" : "Mohammad S Anwar", "data" : [ [ "Perl", @@ -178,7 +333,6 @@ 1 ] ], - "name" : "Mohammad S Anwar", "id" : "Mohammad S Anwar" }, { @@ -192,8 +346,18 @@ "name" : "Niels van Dijke" }, { - "id" : "Roger Bell_West", + "name" : "Pete Houston", + "data" : [ + [ + "Perl", + 2 + ] + ], + "id" : "Pete Houston" + }, + { "name" : "Roger Bell_West", + "id" : "Roger Bell_West", "data" : [ [ "Perl", @@ -225,17 +389,16 @@ }, { "name" : "Simon Proctor", - "id" : "Simon Proctor", "data" : [ [ "Raku", 1 ] - ] + ], + "id" : "Simon Proctor" }, { "id" : "Stuart Little", - "name" : "Stuart Little", "data" : [ [ "Perl", @@ -245,9 +408,12 @@ "Raku", 2 ] - ] + ], + "name" : "Stuart Little" }, { + "name" : "Ulrich Rieke", + "id" : "Ulrich Rieke", "data" : [ [ "Perl", @@ -257,9 +423,7 @@ "Raku", 2 ] - ], - "name" : "Ulrich Rieke", - "id" : "Ulrich Rieke" + ] }, { "data" : [ @@ -272,171 +436,22 @@ 1 ] ], - "name" : "W. Luis Mochan", - "id" : "W. Luis Mochan" + "id" : "W. Luis Mochan", + "name" : "W. Luis Mochan" }, { + "name" : "Wanderdoc", + "id" : "Wanderdoc", "data" : [ [ "Perl", 2 ] - ], - "id" : "Wanderdoc", - "name" : "Wanderdoc" + ] } ] }, - "xAxis" : { - "type" : "category" - }, - "legend" : { - "enabled" : 0 - }, - "subtitle" : { - "text" : "[Champions: 22] Last updated at 2021-04-18 16:18:19 GMT" - }, - "plotOptions" : { - "series" : { - "borderWidth" : 0, - "dataLabels" : { - "format" : "{point.y}", - "enabled" : 1 - } - } - }, - "yAxis" : { - "title" : { - "text" : "Total Solutions" - } - }, - "chart" : { - "type" : "column" - }, "title" : { "text" : "Perl Weekly Challenge - 108" - }, - "series" : [ - { - "data" : [ - { - "drilldown" : "Aaron Smith", - "name" : "Aaron Smith", - "y" : 3 - }, - { - "drilldown" : "Athanasius", - "name" : "Athanasius", - "y" : 3 - }, - { - "drilldown" : "Cheok-Yin Fung", - "name" : "Cheok-Yin Fung", - "y" : 1 - }, - { - "drilldown" : "Colin Crain", - "y" : 5, - "name" : "Colin Crain" - }, - { - "name" : "Daniel Bowling", - "y" : 2, - "drilldown" : "Daniel Bowling" - }, - { - "drilldown" : "Dave Jacoby", - "y" : 3, - "name" : "Dave Jacoby" - }, - { - "y" : 2, - "name" : "E. Choroba", - "drilldown" : "E. Choroba" - }, - { - "name" : "James Smith", - "y" : 2, - "drilldown" : "James Smith" - }, - { - "drilldown" : "Jan Krnavek", - "y" : 2, - "name" : "Jan Krnavek" - }, - { - "drilldown" : "Jorg Sommrey", - "name" : "Jorg Sommrey", - "y" : 2 - }, - { - "drilldown" : "Laurent Rosenfeld", - "y" : 5, - "name" : "Laurent Rosenfeld" - }, - { - "name" : "Luca Ferrari", - "y" : 4, - "drilldown" : "Luca Ferrari" - }, - { - "drilldown" : "Mark Anderson", - "name" : "Mark Anderson", - "y" : 2 - }, - { - "y" : 3, - "name" : "Mohammad S Anwar", - "drilldown" : "Mohammad S Anwar" - }, - { - "drilldown" : "Niels van Dijke", - "y" : 2, - "name" : "Niels van Dijke" - }, - { - "drilldown" : "Roger Bell_West", - "y" : 5, - "name" : "Roger Bell_West" - }, - { - "drilldown" : "Simon Green", - "y" : 3, - "name" : "Simon Green" - }, - { - "name" : "Simon Proctor", - "y" : 1, - "drilldown" : "Simon Proctor" - }, - { - "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" : "Wanderdoc", - "y" : 2, - "drilldown" : "Wanderdoc" - } - ], - "colorByPoint" : 1, - "name" : "Perl Weekly Challenge - 108" - } - ], - "tooltip" : { - "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/>", - "followPointer" : 1 } } diff --git a/stats/pwc-language-breakdown-summary.json b/stats/pwc-language-breakdown-summary.json index 2449e9f051..bbcf8a1993 100644 --- a/stats/pwc-language-breakdown-summary.json +++ b/stats/pwc-language-breakdown-summary.json @@ -1,33 +1,16 @@ { - "subtitle" : { - "text" : "Last updated at 2021-04-18 16:18:19 GMT" + "tooltip" : { + "pointFormat" : "<b>{point.y:.0f}</b>" }, - "xAxis" : { - "type" : "category", - "labels" : { - "style" : { - "fontFamily" : "Verdana, sans-serif", - "fontSize" : "13px" - } - } + "title" : { + "text" : "Perl Weekly Challenge Contributions [2019 - 2020]" }, "legend" : { "enabled" : "false" }, "series" : [ { - "dataLabels" : { - "color" : "#FFFFFF", - "format" : "{point.y:.0f}", - "enabled" : "true", - "y" : 10, - "align" : "right", - "rotation" : -90, - "style" : { - "fontSize" : "13px", - "fontFamily" : "Verdana, sans-serif" - } - }, + "name" : "Contributions", "data" : [ [ "Blog", @@ -35,29 +18,46 @@ ], [ "Perl", - 5096 + 5098 ], [ "Raku", 3239 ] ], - "name" : "Contributions" + "dataLabels" : { + "enabled" : "true", + "style" : { + "fontSize" : "13px", + "fontFamily" : "Verdana, sans-serif" + }, + "color" : "#FFFFFF", + "rotation" : -90, + "format" : "{point.y:.0f}", + "y" : 10, + "align" : "right" + } } ], - "tooltip" : { - "pointFormat" : "<b>{point.y:.0f}</b>" - }, "chart" : { "type" : "column" }, + "xAxis" : { + "labels" : { + "style" : { + "fontSize" : "13px", + "fontFamily" : "Verdana, sans-serif" + } + }, + "type" : "category" + }, "yAxis" : { + "min" : 0, "title" : { "text" : null - }, - "min" : 0 + } }, - "title" : { - "text" : "Perl Weekly Challenge Contributions [2019 - 2020]" + "subtitle" : { + "text" : "Last updated at 2021-04-18 16:30:50 GMT" } } diff --git a/stats/pwc-language-breakdown.json b/stats/pwc-language-breakdown.json index 2134eea79d..4415051bf3 100644 --- a/stats/pwc-language-breakdown.json +++ b/stats/pwc-language-breakdown.json @@ -1,18 +1,29 @@ { - "subtitle" : { - "text" : "Click the columns to drilldown the language breakdown. Last updated at 2021-04-18 16:18:19 GMT" - }, "legend" : { "enabled" : "false" }, - "xAxis" : { - "type" : "category" + "plotOptions" : { + "series" : { + "dataLabels" : { + "enabled" : 1, + "format" : "{point.y}" + }, + "borderWidth" : 0 + } + }, + "tooltip" : { + "headerFormat" : "<span style=\"font-size:11px\"></span>", + "pointFormat" : "<span style=\"color:{point.color}\">Challenge {point.name}</span>: <b>{point.y:f}</b><br/>", + "followPointer" : "true" + }, + "title" : { + "text" : "Perl Weekly Challenge Language" }, "drilldown" : { "series" : [ { - "id" : "001", "name" : "001", + "id" : "001", "data" : [ [ "Perl", @@ -29,6 +40,8 @@ ] }, { + "name" : "002", + "id" : "002", "data" : [ [ "Perl", @@ -42,11 +55,10 @@ "Blog", 10 ] - ], - "name" : "002", - "id" : "002" + ] }, { + "id" : "003", "data" : [ [ "Perl", @@ -61,10 +73,10 @@ 9 ] ], - "id" : "003", "name" : "003" }, { + "id" : "004", "data" : [ [ "Perl", @@ -79,10 +91,10 @@ 10 ] ], - "name" : "004", - "id" : "004" + "name" : "004" }, { + "name" : "005", "data" : [ [ "Perl", @@ -97,10 +109,11 @@ 12 ] ], - "id" : "005", - "name" : "005" + "id" : "005" }, { + "name" : "006", + "id" : "006", "data" : [ [ "Perl", @@ -114,13 +127,9 @@ "Blog", 7 ] - ], - "name" : "006", - "id" : "006" + ] }, { - "name" : "007", - "id" : "007", "data" : [ [ "Perl", @@ -134,11 +143,12 @@ "Blog", 10 ] - ] + ], + "id" : "007", + "name" : "007" }, { "id" : "008", - "name" : "008", "data" : [ [ "Perl", @@ -152,9 +162,11 @@ "Blog", 12 ] - ] + ], + "name" : "008" }, { + "name" : "009", "data" : [ [ "Perl", @@ -169,10 +181,11 @@ 13 ] ], - "name" : "009", "id" : "009" }, { + "name" : "010", + "id" : "010", "data" : [ [ "Perl", @@ -186,11 +199,11 @@ "Blog", 11 ] - ], - "id" : "010", - "name" : "010" + ] }, { + "name" : "011", + "id" : "011", "data" : [ [ "Perl", @@ -204,11 +217,10 @@ "Blog", 10 ] - ], - "name" : "011", - "id" : "011" + ] }, { + "id" : "012", "data" : [ [ "Perl", @@ -223,12 +235,10 @@ 11 ] ], - "name" : "012", - "id" : "012" + "name" : "012" }, { "id" : "013", - "name" : "013", "data" : [ [ "Perl", @@ -242,10 +252,10 @@ "Blog", 13 ] - ] + ], + "name" : "013" }, { - "name" : "014", "id" : "014", "data" : [ [ @@ -260,11 +270,11 @@ "Blog", 15 ] - ] + ], + "name" : "014" }, { "id" : "015", - "name" : "015", "data" : [ [ "Perl", @@ -278,11 +288,11 @@ "Blog", 15 ] - ] + ], + "name" : "015" }, { "id" : "016", - "name" : "016", |
