From f09d206bc9f579d0cb4e208ac79fe755651167d5 Mon Sep 17 00:00:00 2001 From: drbaggy Date: Mon, 27 Sep 2021 08:51:38 +0100 Subject: pushed new solutions --- challenge-132/james-smith/README.md | 64 +++++++++++++++++----------------- challenge-132/james-smith/blog.txt | 1 + challenge-132/james-smith/perl/ch-1.pl | 28 +++++++++++++++ challenge-132/james-smith/perl/ch-2.pl | 40 +++++++++++++++++++++ 4 files changed, 101 insertions(+), 32 deletions(-) create mode 100644 challenge-132/james-smith/blog.txt create mode 100644 challenge-132/james-smith/perl/ch-1.pl create mode 100644 challenge-132/james-smith/perl/ch-2.pl diff --git a/challenge-132/james-smith/README.md b/challenge-132/james-smith/README.md index 5c3ce0ff49..92f8a52f25 100644 --- a/challenge-132/james-smith/README.md +++ b/challenge-132/james-smith/README.md @@ -1,4 +1,4 @@ -# Perl Weekly Challenge #131 +# Perl Weekly Challenge #132 You can find more information about this weeks, and previous weeks challenges at: @@ -10,53 +10,53 @@ submit solutions in whichever language you feel comfortable with. You can find the solutions here on github at: -https://github.com/drbaggy/perlweeklychallenge-club/tree/master/challenge-131/james-smith/perl +https://github.com/drbaggy/perlweeklychallenge-club/tree/master/challenge-132/james-smith/perl -# Task 1 - Consecutive Arrays +# Task 1 - Mirror dates -***You are given a sorted list of unique positive integers. Write a script to return list of arrays where the arrays are consecutive integers.*** +***You are given a date (yyyy/mm/dd). Assuming, the given date is your date of birth. Write a script to find the mirror dates of the given date.*** ## The solution -There isn't much to the solution, we are going to return the data as an array of arrayrefs each containing consecutive numbers. - - * We start by creating our first arrayref containing the first value. {for the `if` code to work without an edge case we need in element in our first arrayref to compare against) - * We then loop through the values: - * if the next number is 1 greater than the last value in the last arrayref. We push it there, - * otherwise we create a new arrayref and push it on the end of our array. - * We "cheat" a bit with the `if` statement - by replace `if( $a ) { $b } else { $c }` with `($a) ? ($b) : ($c)` this means we can use it inline within a `foreach` loop. ```perl -sub conseq { - my @val = @{$_[0]}; - my @res = ( [shift @val] ); - ( $_ == 1 + $res[-1][-1] ) ? (push @{$res[-1]},$_) : (push @res,[$_]) for @val; - \@res; +my @TODAY = @ARGV ? split m{/}, $ARGV[0]: Today; + +sub mirror_days { + my $d = Delta_Days( @TODAY, split m{/}, $_->[0] ); + return [ + sprintf( '%04d/%02d/%02d', Add_Delta_Days( @bd, $d )), + sprintf( '%04d/%02d/%02d', Add_Delta_Days( @TODAY, -$d )), + ]; } ``` -# Task 2 - Find Pairs +# Task 2 - Hash join + +***Write a script to implement Hash Join algorithm as suggested by wikipedia.*** -***You are given a string of delimiter pairs and a string to search. Write a script to return two strings, the first with any characters matching the 'opening character' set, the second with any matching the 'closing character' set.*** + * For each tuple r in the build input R + * Add r to the in-memory hash table + * If the size of the hash table equals the maximum in-memory size: + * Scan the probe input S, and add matching join tuples to the output relation + * Reset the hash table, and continue scanning the build input R + * Do a final scan of the probe input S and add the resulting join tuples to the output relation ## Solution -We solve this with a one liner.... which is below: ```perl -sub find_pairs { - map { join '', $_[1] =~ /$_/g } - map { '(['.quotemeta($_).'])' } - map { join '', $_[0] =~ /$_/g } - '(.).?', '.(.?)'; +my $MAX = @ARGV ? $ARGV[0] : 4; +my @res; + +while( my @pns = splice @player_names, 0, $MAX ) { + my %cache = (); + push @{$cache{$_->[0]}},$_->[1] foreach @pns; + foreach my $p (@player_ages) { + push @res, [$p->[0], $p->[1], $_] foreach @{$cache{$p->[1]}}; + } } -``` -A bit of an explanation on this one.... - - * Working backwards we define two regex `(.).` & `.(.)` these when combined with `/g` return alternate characters in the string - either starting from the first char or the 2nd. - * We then join these together to get two lists of characters. - * We convert them into a regex by using quotemeta to remove the "specialness" and then wrapping them in "([ ])" to capture them - * We just run this regex against our original string (with `/g` again) to get results. +printf "%4d\t%-20s\t%-20s\n", @{$_} foreach @res; +``` diff --git a/challenge-132/james-smith/blog.txt b/challenge-132/james-smith/blog.txt new file mode 100644 index 0000000000..daa5120ef8 --- /dev/null +++ b/challenge-132/james-smith/blog.txt @@ -0,0 +1 @@ +https://github.com/drbaggy/perlweeklychallenge-club/tree/master/challenge-132/james-smith diff --git a/challenge-132/james-smith/perl/ch-1.pl b/challenge-132/james-smith/perl/ch-1.pl new file mode 100644 index 0000000000..341b27629e --- /dev/null +++ b/challenge-132/james-smith/perl/ch-1.pl @@ -0,0 +1,28 @@ +#!/usr/local/bin/perl + +use strict; + +use warnings; +use feature qw(say); +use Test::More; +use Date::Calc qw( Today Delta_Days Add_Delta_Days ); + +my @TODAY = @ARGV ? split m{/}, $ARGV[0]: Today; + +my @TESTS = ( + [ '2021/09/18', '2021/09/14-2021/09/26' ], + [ '1975/10/10', '1929/10/27-2067/09/05' ], + [ '1967/02/14', '1912/07/08-2076/04/30' ], +); + +is( join( '-', @{mirror_days($_->[0])} ), $_->[1] ) foreach @TESTS; + +done_testing(); + +sub mirror_days { + my $d = Delta_Days( @TODAY, split m{/}, $_->[0] ); ## Days between today and birthday + return [ + sprintf( '%04d/%02d/%02d', Add_Delta_Days( @bd, $d )), + sprintf( '%04d/%02d/%02d', Add_Delta_Days( @TODAY, -$d )), + ]; +} diff --git a/challenge-132/james-smith/perl/ch-2.pl b/challenge-132/james-smith/perl/ch-2.pl new file mode 100644 index 0000000000..86096aac26 --- /dev/null +++ b/challenge-132/james-smith/perl/ch-2.pl @@ -0,0 +1,40 @@ +#!/usr/local/bin/perl + +use strict; + +use warnings; +use feature qw(say); +use Test::More; +use Benchmark qw(cmpthese timethis); +use Data::Dumper qw(Dumper); + +my @player_ages = ( + [20, "Alex" ], + [28, "Joe" ], + [38, "Mike" ], + [18, "Alex" ], + [25, "David" ], + [18, "Simon" ], +); + +my @player_names = ( + ["Alex", "Stewart"], + ["Joe", "Root" ], + ["Mike", "Gatting"], + ["Joe", "Blog" ], + ["Alex", "Jones" ], + ["Simon","Duane" ], +); + +my $MAX = @ARGV ? $ARGV[0] : 4; + +my @res; +while( my @pns = splice @player_names, 0, $MAX ) { + my %cache = (); + push @{$cache{$_->[0]}},$_->[1] foreach @pns; + foreach my $p (@player_ages) { + push @res, [$p->[0], $p->[1], $_] foreach @{$cache{$p->[1]}}; + } +} +printf "%4d\t%-20s\t%-20s\n", @{$_} foreach @res; + -- cgit From 1f44f17ccac3048ea297126ab45f704a64696eda Mon Sep 17 00:00:00 2001 From: Luca Ferrari Date: Mon, 27 Sep 2021 10:15:55 +0200 Subject: Task 1 done --- challenge-132/luca-ferrari/raku/ch-1.p6 | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 challenge-132/luca-ferrari/raku/ch-1.p6 diff --git a/challenge-132/luca-ferrari/raku/ch-1.p6 b/challenge-132/luca-ferrari/raku/ch-1.p6 new file mode 100644 index 0000000000..933e32be36 --- /dev/null +++ b/challenge-132/luca-ferrari/raku/ch-1.p6 @@ -0,0 +1,15 @@ +#!raku + + +multi sub MAIN( Str $date where { $date ~~ / \d ** 4 '/' \d ** 2 '/' \d ** 2 / } ) { + $date ~~ / (\d ** 4 ) '/' (\d ** 2 ) '/' ( \d **2 ) /; + MAIN( $0 ~ '-' ~ $1 ~ '-' ~ $2 ); +} + +multi sub MAIN( Str $date where { $date ~~ / \d ** 4 '-' \d ** 2 '-' \d ** 2 / } ) { + my $birthday = Date.new: $date; + my $today = Date.today; + my $days = $today - $birthday; + my @dates = $birthday - $days, $today + $days; + @dates.join( ', ' ).say; +} -- cgit From 7fce88d8caf401d5390ec43b5047478eb55fb4da Mon Sep 17 00:00:00 2001 From: Luca Ferrari Date: Mon, 27 Sep 2021 10:39:16 +0200 Subject: Task 2 done --- challenge-132/luca-ferrari/raku/ch-2.p6 | 50 +++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 challenge-132/luca-ferrari/raku/ch-2.p6 diff --git a/challenge-132/luca-ferrari/raku/ch-2.p6 b/challenge-132/luca-ferrari/raku/ch-2.p6 new file mode 100644 index 0000000000..8a3acbdf4b --- /dev/null +++ b/challenge-132/luca-ferrari/raku/ch-2.p6 @@ -0,0 +1,50 @@ +#!raku + + +class HashTable { + # hash of the table + has Int $.size = 2; + + method !doMatch( @memory, @S, $r-index, $s-index ) { + for @memory -> $rr { + for @S -> $s { + say $rr.join( ' ' ) ~ $s[ 0 .. $s-index - 1, $s-index + 1 .. * - 1 ],join( ' ' ) if $s[ $s-index ] ~~ $rr[ $r-index ]; + } + } + + @memory = (); + } + + method match( @R, @S, Int $r-index = 0, Int $s-index = 0 ) { + my @memory; + for @R -> $r { + @memory.push: $r; + self!doMatch( @memory, @S, $r-index, $s-index ) if @memory.elems == $!size; + } + + self!doMatch( @memory, @S, $r-index, $s-index ) if @memory; + } +} + +sub MAIN() { + my @player_ages = + [20, "Alex" ], + [28, "Joe" ], + [38, "Mike" ], + [18, "Alex" ], + [25, "David" ], + [18, "Simon" ], + ; + + my @player_names = + ["Alex", "Stewart"], + ["Joe", "Root" ], + ["Mike", "Gatting"], + ["Joe", "Blog" ], + ["Alex", "Jones" ], + ["Simon","Duane" ], + ; + + my $hash = HashTable.new; + $hash.match( @player_ages, @player_names, 1, 0 ); +} -- cgit From 84502965d2be5006cd6b6e2ff431bae59597ee52 Mon Sep 17 00:00:00 2001 From: Mark A Date: Mon, 27 Sep 2021 03:04:37 -0600 Subject: Challenge 132 Solutions (Raku) --- challenge-132/mark-anderson/raku/ch-1.raku | 14 +++++++++++++ challenge-132/mark-anderson/raku/ch-2.raku | 33 ++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 challenge-132/mark-anderson/raku/ch-1.raku create mode 100644 challenge-132/mark-anderson/raku/ch-2.raku diff --git a/challenge-132/mark-anderson/raku/ch-1.raku b/challenge-132/mark-anderson/raku/ch-1.raku new file mode 100644 index 0000000000..fd0fa2a4cd --- /dev/null +++ b/challenge-132/mark-anderson/raku/ch-1.raku @@ -0,0 +1,14 @@ +#!/usr/bin/env raku + +say mirror-dates('1967/02/14'); + +sub mirror-dates($date) +{ + my $t = Date.today; + my $d = Date.new(|$date.split("/")); + + my $days = $t - $d; + + ($d.earlier(:$days).yyyy-mm-dd('/'), + $t.later(:$days).yyyy-mm-dd('/')); +} diff --git a/challenge-132/mark-anderson/raku/ch-2.raku b/challenge-132/mark-anderson/raku/ch-2.raku new file mode 100644 index 0000000000..9f7976f138 --- /dev/null +++ b/challenge-132/mark-anderson/raku/ch-2.raku @@ -0,0 +1,33 @@ +#!/usr/bin/env raku + +my @players-age = ( + < 20 Alex >, + < 28 Joe >, + < 38 Mike >, + < 18 Alex >, + < 25 David >, + < 18 Simon >, +); + +my @players-name = ( + < Alex Stewart >, + < Joe Root >, + < Mike Gatting >, + < Joe Blog >, + < Alex Jones >, + < Simon Duane >, +); + +my %a = @players-age.classify({ .[1] }, :as{ .[0] }); +my %n = @players-name.classify({ .[0] }, :as{ .[1] }); + +for %a.keys.sort -> $k +{ + if %n{$k}:exists + { + for %a{$k}<> X %n{$k}<> + { + printf("%-3d%-6s%s\n", .[0], $k, .[1]); + } + } +} -- cgit From a00f239868b2af20d36d6a793e1b70e666ddfa61 Mon Sep 17 00:00:00 2001 From: Luca Ferrari Date: Mon, 27 Sep 2021 11:20:11 +0200 Subject: Blog references --- challenge-132/luca-ferrari/blog-1.txt | 1 + challenge-132/luca-ferrari/blog-2.txt | 1 + 2 files changed, 2 insertions(+) create mode 100644 challenge-132/luca-ferrari/blog-1.txt create mode 100644 challenge-132/luca-ferrari/blog-2.txt diff --git a/challenge-132/luca-ferrari/blog-1.txt b/challenge-132/luca-ferrari/blog-1.txt new file mode 100644 index 0000000000..ea33d5406c --- /dev/null +++ b/challenge-132/luca-ferrari/blog-1.txt @@ -0,0 +1 @@ +https://fluca1978.github.io/2021/09/27/PerlWeeklyChallenge132.html#task1 diff --git a/challenge-132/luca-ferrari/blog-2.txt b/challenge-132/luca-ferrari/blog-2.txt new file mode 100644 index 0000000000..42eaf3228b --- /dev/null +++ b/challenge-132/luca-ferrari/blog-2.txt @@ -0,0 +1 @@ +https://fluca1978.github.io/2021/09/27/PerlWeeklyChallenge132.html#task2 -- cgit From ba5a51a6f5a32cf52e8a0b12fbb3d787f7dbd994 Mon Sep 17 00:00:00 2001 From: Mark A Date: Mon, 27 Sep 2021 03:21:30 -0600 Subject: Challenge 132 Solutions (Raku) --- challenge-132/mark-anderson/raku/ch-2.raku | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/challenge-132/mark-anderson/raku/ch-2.raku b/challenge-132/mark-anderson/raku/ch-2.raku index 9f7976f138..215b866c0e 100644 --- a/challenge-132/mark-anderson/raku/ch-2.raku +++ b/challenge-132/mark-anderson/raku/ch-2.raku @@ -1,22 +1,18 @@ #!/usr/bin/env raku -my @players-age = ( - < 20 Alex >, - < 28 Joe >, - < 38 Mike >, - < 18 Alex >, - < 25 David >, - < 18 Simon >, -); +my @players-age = < 20 Alex >, + < 28 Joe >, + < 38 Mike >, + < 18 Alex >, + < 25 David >, + < 18 Simon >; -my @players-name = ( - < Alex Stewart >, - < Joe Root >, - < Mike Gatting >, - < Joe Blog >, - < Alex Jones >, - < Simon Duane >, -); +my @players-name = < Alex Stewart >, + < Joe Root >, + < Mike Gatting >, + < Joe Blog >, + < Alex Jones >, + < Simon Duane >; my %a = @players-age.classify({ .[1] }, :as{ .[0] }); my %n = @players-name.classify({ .[0] }, :as{ .[1] }); -- cgit From ef1442d94bcaf888ad1488fdf68870e06f26dc3d Mon Sep 17 00:00:00 2001 From: Mark A Date: Mon, 27 Sep 2021 03:33:39 -0600 Subject: Challenge 132 Solutions (Raku) --- challenge-132/mark-anderson/raku/ch-1.raku | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/challenge-132/mark-anderson/raku/ch-1.raku b/challenge-132/mark-anderson/raku/ch-1.raku index fd0fa2a4cd..f3111a3834 100644 --- a/challenge-132/mark-anderson/raku/ch-1.raku +++ b/challenge-132/mark-anderson/raku/ch-1.raku @@ -5,7 +5,7 @@ say mirror-dates('1967/02/14'); sub mirror-dates($date) { my $t = Date.today; - my $d = Date.new(|$date.split("/")); + my $d = Date.new($date.trans('/' => '-')); my $days = $t - $d; -- cgit From e9aed0e41b697f8da726920a4117c6e98f2ea08f Mon Sep 17 00:00:00 2001 From: James Smith Date: Mon, 27 Sep 2021 11:49:40 +0100 Subject: Update README.md --- challenge-132/james-smith/README.md | 40 +++++++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/challenge-132/james-smith/README.md b/challenge-132/james-smith/README.md index 92f8a52f25..6754349a4c 100644 --- a/challenge-132/james-smith/README.md +++ b/challenge-132/james-smith/README.md @@ -18,7 +18,9 @@ https://github.com/drbaggy/perlweeklychallenge-club/tree/master/challenge-132/ja ## The solution - +Here we use Date::Calc module to handle the date time manipulations. + +We compute the number of days between dob & today. We then work out which day is this distance before the dob & after today to give the two values. ```perl my @TODAY = @ARGV ? split m{/}, $ARGV[0]: Today; @@ -45,18 +47,48 @@ sub mirror_days { ## Solution +The problem is "simple" seems simple to begin with - but there are two "gotchas".. + + * We have to chunk the first array up into chunks of no more than `$N`. + * The keys in the two tables are NOT unique, so we need to store multiple values based on a key; + +To solve the first problem we break the input array up into to chunks of size `$MAX`, and repeat foreach one. + +To resolve the issue of the multiple keys, instead of the value of the cache being the value itself, it is the key to an array of values. + +Although not needed - the code is written to match the description above - so works with multiple non key columns in both tables. ```perl + +## index of key columns... +my $ages_key = 1; +my $names_key = 0; + +## Get non-key columns in the names table... +## { get all column ids and splice out the key column} +my @names_columns = 0..(@{$player_names[0]}-1); +splice @names_columns, $names_key,1; ## Remove key.... + +## Get chunk size (default to 4) my $MAX = @ARGV ? $ARGV[0] : 4; + my @res; while( my @pns = splice @player_names, 0, $MAX ) { my %cache = (); - push @{$cache{$_->[0]}},$_->[1] foreach @pns; + ## Foreach we key on the key column, and store the non-key columns + ## Because key columns not unique we have array of arrays for + ## the hash values + push @{$cache{$_->[$names_key]}},[ @{$_}[@names_columns] ] foreach @pns; + + ## Now loop through the array of ages. + ## When we find a key we dump all values. + ## We push all values in the ages table - and all values (except the key) of the names table foreach my $p (@player_ages) { - push @res, [$p->[0], $p->[1], $_] foreach @{$cache{$p->[1]}}; + push @res, [@{$p}, @{$_}] foreach @{$cache{$p->[$ages_key]}}; } } -printf "%4d\t%-20s\t%-20s\n", @{$_} foreach @res; +## Just print values +say join "\t", map { sprintf '%-15s', $_ } @{$_} foreach @res; ``` -- cgit From d27a4828c6aad0678a59e864b13e10fe89871ceb Mon Sep 17 00:00:00 2001 From: drbaggy Date: Mon, 27 Sep 2021 11:50:23 +0100 Subject: fixes to code to work with multi column arrays --- challenge-132/james-smith/perl/ch-2.pl | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/challenge-132/james-smith/perl/ch-2.pl b/challenge-132/james-smith/perl/ch-2.pl index 86096aac26..446b66833c 100644 --- a/challenge-132/james-smith/perl/ch-2.pl +++ b/challenge-132/james-smith/perl/ch-2.pl @@ -26,15 +26,35 @@ my @player_names = ( ["Simon","Duane" ], ); +## index of key columns... +my $ages_key = 1; +my $names_key = 0; + +## Get non-key columns in the names table... +## { get all column ids and splice out the key column} +my @names_columns = 0..(@{$player_names[0]}-1); +splice @names_columns, $names_key,1; ## Remove key.... + +## Get chunk size (default to 4) my $MAX = @ARGV ? $ARGV[0] : 4; my @res; + while( my @pns = splice @player_names, 0, $MAX ) { my %cache = (); - push @{$cache{$_->[0]}},$_->[1] foreach @pns; + ## Foreach we key on the key column, and store the non-key columns + ## Because key columns not unique we have array of arrays for + ## the hash values + push @{$cache{$_->[$names_key]}},[ @{$_}[@names_columns] ] foreach @pns; + + ## Now loop through the array of ages. + ## When we find a key we dump all values. + ## We push all values in the ages table - and all values (except the key) of the names table foreach my $p (@player_ages) { - push @res, [$p->[0], $p->[1], $_] foreach @{$cache{$p->[1]}}; + push @res, [@{$p}, @{$_}] foreach @{$cache{$p->[$ages_key]}}; } } -printf "%4d\t%-20s\t%-20s\n", @{$_} foreach @res; + +## Just print values +say join "\t", map { sprintf '%-15s', $_ } @{$_} foreach @res; -- cgit From 3e0ef063102fd8d25be76ac2dc036a035d9d7f13 Mon Sep 17 00:00:00 2001 From: E7-87-83 Date: Mon, 27 Sep 2021 20:03:40 +0800 Subject: TWC 132, Task 1 in 3 languages --- challenge-132/cheok-yin-fung/java/MirrorDates.java | 28 +++++++++++++++ challenge-132/cheok-yin-fung/julia/ch-1.jl | 34 ++++++++++++++++++ challenge-132/cheok-yin-fung/perl/ch-1.pl | 42 ++++++++++++++++++++++ 3 files changed, 104 insertions(+) create mode 100644 challenge-132/cheok-yin-fung/java/MirrorDates.java create mode 100644 challenge-132/cheok-yin-fung/julia/ch-1.jl create mode 100644 challenge-132/cheok-yin-fung/perl/ch-1.pl diff --git a/challenge-132/cheok-yin-fung/java/MirrorDates.java b/challenge-132/cheok-yin-fung/java/MirrorDates.java new file mode 100644 index 0000000000..238f259d83 --- /dev/null +++ b/challenge-132/cheok-yin-fung/java/MirrorDates.java @@ -0,0 +1,28 @@ +// The Weekly Challenge - 132 +// Task 1 Mirror Dates +// Usage: java MirrorDates YYYY MM DD + +import java.time.LocalDate; +import java.time.YearMonth; + +public class MirrorDates +{ + public static void main(String[] args) + { + int year = Integer.parseInt(args[0]); + int month = Integer.parseInt(args[1]); + int day = Integer.parseInt(args[2]); + + mirror_dates(year, month, day); + } + + public static void mirror_dates (int birth_year,int birth_month, int birth_day) { + LocalDate my_today = LocalDate.of(2021,9,22); + LocalDate birthday = LocalDate.of(birth_year, birth_month, birth_day); + long y1 = my_today.toEpochDay() - birthday.toEpochDay(); + LocalDate d_senior = birthday.minusDays(y1); + LocalDate d_junior = my_today.plusDays(y1); + System.out.println(d_senior); + System.out.println(d_junior); + } +} diff --git a/challenge-132/cheok-yin-fung/julia/ch-1.jl b/challenge-132/cheok-yin-fung/julia/ch-1.jl new file mode 100644 index 0000000000..24eb6f5aa3 --- /dev/null +++ b/challenge-132/cheok-yin-fung/julia/ch-1.jl @@ -0,0 +1,34 @@ +# The Weekly Challenge Week 132 +# Task 1 Mirror Dates +# Usage: include("ch-1.jl") +# mirror_dates(Date(YYYY,MM,DD)) + +using Dates + +function mirror_dates(my_date_of_birth) + my_today = Date(2021,09,22) + y1 = Dates.values(my_today - my_date_of_birth) + d_senior = my_date_of_birth - Dates.Day(y1) + d_junior = my_today + Dates.Day(y1) + println(d_senior) + println(d_junior) +end + + +# julia> include("ch-1.jl") + +# #Example 1 +# julia> mirror_dates(Date(2021,09,18)) +# 2021-09-14 +# 2021-09-26 + +# #Example 2 +# julia> mirror_dates(Date(1975,10,10)) +# 1929-10-27 +# 2067-09-05 + +# #Example 3 +# julia> mirror_dates(Date(1967,02,14)) +# 1912-07-08 +# 2076-04-30 + diff --git a/challenge-132/cheok-yin-fung/perl/ch-1.pl b/challenge-132/cheok-yin-fung/perl/ch-1.pl new file mode 100644 index 0000000000..7bfe736e7d --- /dev/null +++ b/challenge-132/cheok-yin-fung/perl/ch-1.pl @@ -0,0 +1,42 @@ +#!/usr/bin/perl +# The Weekly Challenge 131 +# Task 1 Mirror Dates +# Usage: ch-1.pl YYYY/MM/DD +use v5.24.0; +use warnings; +use Time::Local qw'timelocal timegm_nocheck'; +use Test::More tests => 3; + +say mirror_str($ARGV[0]) if defined($ARGV[0]); + +sub mirror { + my @arr_today = (22, 8, 2021); # Wed Sep 22 2021 + my $_today = timelocal(0, 0, 0, @arr_today); + my @arr_birth = ($_[2], $_[1]-1, $_[0]); + my $_birth = timelocal(0, 0, 0, @arr_birth); + my $sec_diff = $_today - $_birth; + my $y1 = int (($_today - $_birth)/86400); + my @d_senior = localtime timegm_nocheck 0, 0, 0, $arr_birth[0]-$y1, $arr_birth[1], $arr_birth[2]; + my @d_junior = localtime timegm_nocheck 0, 0, 0, $arr_today[0]+$y1, $arr_today[1], $arr_today[2]; + return [ [@d_senior], [@d_junior] ]; +} + +sub mirror_str { + my ($byear, $bmonth, $bday) = split /\//, $_[0]; + $bmonth =~ s/^0//; # remove leading zeros + $bday =~ s/^0//; # remove leading zeros + my ($d_s, $d_j) = mirror($byear, $bmonth, $bday)->@*; + + return + ($d_s->[5]+1900)."/" + .($d_s->[4]<=8 ? 0 : "").($d_s->[4]+1)."/" + .($d_s->[3]<10 ? 0 : "").($d_s->[3]) + .", " + .($d_j->[5]+1900)."/" + .($d_j->[4]<=8 ? 0 : "").($d_j->[4]+1)."/" + .($d_j->[3]<10 ? 0 : "").($d_j->[3]); +} + +ok mirror_str("2021/09/18") eq "2021/09/14, 2021/09/26", "Example 1"; +ok mirror_str("1975/10/10") eq "1929/10/27, 2067/09/05", "Example 2"; +ok mirror_str("1967/02/14") eq "1912/07/08, 2076/04/30", "Example 3"; -- cgit From 9811d10284aaffc8303f7f128fca0cea900b18ff Mon Sep 17 00:00:00 2001 From: Mohammad S Anwar Date: Mon, 27 Sep 2021 15:56:52 +0100 Subject: - Added solutions by James Smith. --- stats/pwc-challenge-131.json | 623 ++++++++++ stats/pwc-current.json | 614 +--------- stats/pwc-language-breakdown-summary.json | 60 +- stats/pwc-language-breakdown.json | 1769 +++++++++++++++-------------- stats/pwc-leaders.json | 350 +++--- stats/pwc-summary-1-30.json | 100 +- stats/pwc-summary-121-150.json | 46 +- stats/pwc-summary-151-180.json | 34 +- stats/pwc-summary-181-210.json | 40 +- stats/pwc-summary-211-240.json | 102 +- stats/pwc-summary-31-60.json | 106 +- stats/pwc-summary-61-90.json | 98 +- stats/pwc-summary-91-120.json | 104 +- stats/pwc-summary.json | 24 +- 14 files changed, 2080 insertions(+), 1990 deletions(-) create mode 100644 stats/pwc-challenge-131.json diff --git a/stats/pwc-challenge-131.json b/stats/pwc-challenge-131.json new file mode 100644 index 0000000000..3c45c14f3e --- /dev/null +++ b/stats/pwc-challenge-131.json @@ -0,0 +1,623 @@ +{ + "subtitle" : { + "text" : "[Champions: 33] Last updated at 2021-09-27 14:52:15 GMT" + }, + "chart" : { + "type" : "column" + }, + "xAxis" : { + "type" : "category" + }, + "tooltip" : { + "followPointer" : 1, + "headerFormat" : "{series.name}
", + "pointFormat" : "{point.name}: {point.y:f}
" + }, + "plotOptions" : { + "series" : { + "dataLabels" : { + "format" : "{point.y}", + "enabled" : 1 + }, + "borderWidth" : 0 + } + }, + "title" : { + "text" : "The Weekly Challenge - 131" + }, + "yAxis" : { + "title" : { + "text" : "Total Solutions" + } + }, + "series" : [ + { + "name" : "The Weekly Challenge - 131", + "colorByPoint" : 1, + "data" : [ + { + "name" : "Abigail", + "drilldown" : "Abigail", + "y" : 4 + }, + { + "name" : "Adam Russell", + "drilldown" : "Adam Russell", + "y" : 1 + }, + { + "drilldown" : "Arne Sommer", + "y" : 5, + "name" : "Arne Sommer" + }, + { + "name" : "Athanasius", + "y" : 4, + "drilldown" : "Athanasius" + }, + { + "name" : "Ben Davies", + "y" : 1, + "drilldown" : "Ben Davies" + }, + { + "y" : 3, + "drilldown" : "Cheok-Yin Fung", + "name" : "Cheok-Yin Fung" + }, + { + "drilldown" : "Colin Crain", + "y" : 5, + "name" : "Colin Crain" + }, + { + "name" : "Dave Jacoby", + "drilldown" : "Dave Jacoby", + "y" : 3 + }, + { + "drilldown" : "Duncan C. White", + "y" : 2, + "name" : "Duncan C. White" + }, + { + "name" : "E. Choroba", + "drilldown" : "E. Choroba", + "y" : 2 + }, + { + "name" : "Flavio Poletti", + "drilldown" : "Flavio Poletti", + "y" : 6 + }, + { + "name" : "Ian Goodnight", + "drilldown" : "Ian Goodnight", + "y" : 4 + }, + { + "name" : "Ivan Dimitrov", + "drilldown" : "Ivan Dimitrov", + "y" : 2 + }, + { + "name" : "James Smith", + "drilldown" : "James Smith", + "y" : 3 + }, + { + "y" : 2, + "drilldown" : "Jan Krnavek", + "name" : "Jan Krnavek" + }, + { + "name" : "Jorg Sommrey", + "drilldown" : "Jorg Sommrey", + "y" : 1 + }, + { + "name" : "Laurent Rosenfeld", + "y" : 3, + "drilldown" : "Laurent Rosenfeld" + }, + { + "drilldown" : "Lubos Kolouch", + "y" : 2, + "name" : "Lubos Kolouch" + }, + { + "drilldown" : "Luca Ferrari", + "y" : 4, + "name" : "Luca Ferrari" + }, + { + "drilldown" : "Mark Anderson", + "y" : 2, + "name" : "Mark Anderson" + }, + { + "name" : "Matthew Neleigh", + "y" : 2, + "drilldown" : "Matthew Neleigh" + }, + { + "y" : 1, + "drilldown" : "Mohammad S Anwar", + "name" : "Mohammad S Anwar" + }, + { + "y" : 2, + "drilldown" : "Niels van Dijke", + "name" : "Niels van Dijke" + }, + { + "name" : "Olivier Delouya", + "y" : 1, + "drilldown" : "Olivier Delouya" + }, + { + "name" : "Pete Houston", + "y" : 2, + "drilldown" : "Pete Houston" + }, + { + "drilldown" : "Peter Campbell Smith", + "y" : 2, + "name" : "Peter Campbell Smith" + }, + { + "name" : "Rich Snyder", + "drilldown" : "Rich Snyder", + "y" : 2 + }, + { + "name" : "Roger Bell_West", + "y" : 5, + "drilldown" : "Roger Bell_West" + }, + { + "drilldown" : "Simon Green", + "y" : 3, + "name" : "Simon Green" + }, + { + "name" : "Simon Proctor", + "drilldown" : "Simon Proctor", + "y" : 1 + }, + { + "name" : "Ulrich Rieke", + "y" : 4, + "drilldown" : "Ulrich Rieke" + }, + { + "name" : "W. Luis Mochan", + "drilldown" : "W. Luis Mochan", + "y" : 3 + }, + { + "name" : "Wanderdoc", + "drilldown" : "Wanderdoc", + "y" : 2 + } + ] + } + ], + "drilldown" : { + "series" : [ + { + "name" : "Abigail", + "id" : "Abigail", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Blog", + 2 + ] + ] + }, + { + "name" : "Adam Russell", + "data" : [ + [ + "Perl", + 1 + ] + ], + "id" : "Adam Russell" + }, + { + "id" : "Arne Sommer", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Raku", + 2 + ], + [ + "Blog", + 1 + ] + ], + "name" : "Arne Sommer" + }, + { + "id" : "Athanasius", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Raku", + 2 + ] + ], + "name" : "Athanasius" + }, + { + "name" : "Ben Davies", + "data" : [ + [ + "Raku", + 1 + ] + ], + "id" : "Ben Davies" + }, + { + "data" : [ + [ + "Perl", + 2 + ], + [ + "Blog", + 1 + ] + ], + "id" : "Cheok-Yin Fung", + "name" : "Cheok-Yin Fung" + }, + { + "name" : "Colin Crain", + "id" : "Colin Crain", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Raku", + 2 + ], + [ + "Blog", + 1 + ] + ] + }, + { + "name" : "Dave Jacoby", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Blog", + 1 + ] + ], + "id" : "Dave Jacoby" + }, + { + "name" : "Duncan C. White", + "id" : "Duncan C. White", + "data" : [ + [ + "Perl", + 2 + ] + ] + }, + { + "name" : "E. Choroba", + "id" : "E. Choroba", + "data" : [ + [ + "Perl", + 2 + ] + ] + }, + { + "id" : "Flavio Poletti", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Raku", + 2 + ], + [ + "Blog", + 2 + ] + ], + "name" : "Flavio Poletti" + }, + { + "name" : "Ian Goodnight", + "id" : "Ian Goodnight", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Blog", + 2 + ] + ] + }, + { + "name" : "Ivan Dimitrov", + "data" : [ + [ + "Perl", + 2 + ] + ], + "id" : "Ivan Dimitrov" + }, + { + "data" : [ + [ + "Perl", + 2 + ], + [ + "Blog", + 1 + ] + ], + "id" : "James Smith", + "name" : "James Smith" + }, + { + "name" : "Jan Krnavek", + "data" : [ + [ + "Raku", + 2 + ] + ], + "id" : "Jan Krnavek" + }, + { + "name" : "Jorg Sommrey", + "data" : [ + [ + "Perl", + 1 + ] + ], + "id" : "Jorg Sommrey" + }, + { + "name" : "Laurent Rosenfeld", + "id" : "Laurent Rosenfeld", + "data" : [ + [ + "Perl", + 1 + ], + [ + "Raku", + 1 + ], + [ + "Blog", + 1 + ] + ] + }, + { + "id" : "Lubos Kolouch", + "data" : [ + [ + "Perl", + 2 + ] + ], + "name" : "Lubos Kolouch" + }, + { + "name" : "Luca Ferrari", + "data" : [ + [ + "Raku", + 2 + ], + [ + "Blog", + 2 + ] + ], + "id" : "Luca Ferrari" + }, + { + "data" : [ + [ + "Raku", + 2 + ] + ], + "id" : "Mark Anderson", + "name" : "Mark Anderson" + }, + { + "id" : "Matthew Neleigh", + "data" : [ + [ + "Perl", + 2 + ] + ], + "name" : "Matthew Neleigh" + }, + { + "name" : "Mohammad S Anwar", + "id" : "Mohammad S Anwar", + "data" : [ + [ + "Perl", + 1 + ] + ] + }, + { + "data" : [ + [ + "Perl", + 2 + ] + ], + "id" : "Niels van Dijke", + "name" : "Niels van Dijke" + }, + { + "name" : "Olivier Delouya", + "id" : "Olivier Delouya", + "data" : [ + [ + "Perl", + 1 + ] + ] + }, + { + "name" : "Pete Houston", + "data" : [ + [ + "Perl", + 2 + ] + ], + "id" : "Pete Houston" + }, + { + "name" : "Peter Campbell Smith", + "data" : [ + [ + "Perl", + 2 + ] + ], + "id" : "Peter Campbell Smith" + }, + { + "name" : "Rich Snyder", + "data" : [ + [ + "Perl", + 2 + ] + ], + "id" : "Rich Snyder" + }, + { + "name" : "Roger Bell_West", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Raku", + 2 + ], + [ + "Blog", + 1 + ] + ], + "id" : "Roger Bell_West" + }, + { + "name" : "Simon Green", + "id" : "Simon Green", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Blog", + 1 + ] + ] + }, + { + "id" : "Simon Proctor", + "data" : [ + [ + "Raku", + 1 + ] + ], + "name" : "Simon Proctor" + }, + { + "id" : "Ulrich Rieke", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Raku", + 2 + ] + ], + "name" : "Ulrich Rieke" + }, + { + "data" : [ + [ + "Perl", + 2 + ], + [ + "Blog", + 1 + ] + ], + "id" : "W. Luis Mochan", + "name" : "W. Luis Mochan" + }, + { + "name" : "Wanderdoc", + "data" : [ + [ + "Perl", + 2 + ] + ], + "id" : "Wanderdoc" + } + ] + }, + "legend" : { + "enabled" : 0 + } +} diff --git a/stats/pwc-current.json b/stats/pwc-current.json index e8d1e4df44..c2b379a75d 100644 --- a/stats/pwc-current.json +++ b/stats/pwc-current.json @@ -1,294 +1,55 @@ { - "subtitle" : { - "text" : "[Champions: 33] Last updated at 2021-09-27 02:22:10 GMT" + "yAxis" : { + "title" : { + "text" : "Total Solutions" + } + }, + "title" : { + "text" : "The Weekly Challenge - 132" + }, + "xAxis" : { + "type" : "category" }, "series" : [ { - "name" : "The Weekly Challenge - 131", "colorByPoint" : 1, + "name" : "The Weekly Challenge - 132", "data" : [ { - "name" : "Abigail", - "drilldown" : "Abigail", - "y" : 4 - }, - { - "name" : "Adam Russell", - "drilldown" : "Adam Russell", - "y" : 1 - }, - { - "y" : 5, - "name" : "Arne Sommer", - "drilldown" : "Arne Sommer" - }, - { - "y" : 4, - "drilldown" : "Athanasius", - "name" : "Athanasius" - }, - { - "name" : "Ben Davies", - "drilldown" : "Ben Davies", - "y" : 1 - }, - { - "name" : "Cheok-Yin Fung", - "drilldown" : "Cheok-Yin Fung", - "y" : 3 - }, - { - "y" : 5, - "name" : "Colin Crain", - "drilldown" : "Colin Crain" - }, - { - "drilldown" : "Dave Jacoby", - "name" : "Dave Jacoby", - "y" : 3 - }, - { - "name" : "Duncan C. White", - "drilldown" : "Duncan C. White", - "y" : 2 - }, - { - "drilldown" : "E. Choroba", - "name" : "E. Choroba", - "y" : 2 - }, - { - "y" : 6, - "name" : "Flavio Poletti", - "drilldown" : "Flavio Poletti" - }, - { - "y" : 4, - "drilldown" : "Ian Goodnight", - "name" : "Ian Goodnight" - }, - { - "name" : "Ivan Dimitrov", - "drilldown" : "Ivan Dimitrov", - "y" : 2 - }, - { - "name" : "James Smith", "drilldown" : "James Smith", - "y" : 3 - }, - { - "y" : 2, - "drilldown" : "Jan Krnavek", - "name" : "Jan Krnavek" - }, - { - "name" : "Jorg Sommrey", - "drilldown" : "Jorg Sommrey", - "y" : 1 - }, - { - "drilldown" : "Laurent Rosenfeld", - "name" : "Laurent Rosenfeld", - "y" : 3 - }, - { - "y" : 2, - "drilldown" : "Lubos Kolouch", - "name" : "Lubos Kolouch" - }, - { - "y" : 4, - "name" : "Luca Ferrari", - "drilldown" : "Luca Ferrari" - }, - { - "name" : "Mark Anderson", - "drilldown" : "Mark Anderson", - "y" : 2 - }, - { - "name" : "Matthew Neleigh", - "drilldown" : "Matthew Neleigh", - "y" : 2 - }, - { - "y" : 1, - "name" : "Mohammad S Anwar", - "drilldown" : "Mohammad S Anwar" - }, - { - "y" : 2, - "name" : "Niels van Dijke", - "drilldown" : "Niels van Dijke" - }, - { - "y" : 1, - "name" : "Olivier Delouya", - "drilldown" : "Olivier Delouya" - }, - { - "name" : "Pete Houston", - "drilldown" : "Pete Houston", - "y" : 2 - }, - { - "name" : "Peter Campbell Smith", - "drilldown" : "Peter Campbell Smith", - "y" : 2 - }, - { - "y" : 2, - "drilldown" : "Rich Snyder", - "name" : "Rich Snyder" - }, - { - "drilldown" : "Roger Bell_West", - "name" : "Roger Bell_West", - "y" : 5 - }, - { "y" : 3, - "drilldown" : "Simon Green", - "name" : "Simon Green" - }, - { - "drilldown" : "Simon Proctor", - "name" : "Simon Proctor", - "y" : 1 - }, - { - "name" : "Ulrich Rieke", - "drilldown" : "Ulrich Rieke", - "y" : 4 - }, - { - "y" : 3, - "name" : "W. Luis Mochan", - "drilldown" : "W. Luis Mochan" - }, - { - "name" : "Wanderdoc", - "drilldown" : "Wanderdoc", - "y" : 2 + "name" : "James Smith" } ] } ], + "legend" : { + "enabled" : 0 + }, "plotOptions" : { "series" : { + "borderWidth" : 0, "dataLabels" : { "enabled" : 1, "format" : "{point.y}" - }, - "borderWidth" : 0 + } } }, - "title" : { - "text" : "The Weekly Challenge - 131" + "subtitle" : { + "text" : "[Champions: 1] Last updated at 2021-09-27 14:54:37 GMT" + }, + "chart" : { + "type" : "column" + }, + "tooltip" : { + "pointFormat" : "{point.name}: {point.y:f}
", + "headerFormat" : "{series.name}
", + "followPointer" : 1 }, "drilldown" : { "series" : [ { - "name" : "Abigail", - "data" : [ - [ - "Perl", - 2 - ], - [ - "Blog", - 2 - ] - ], - "id" : "Abigail" - }, - { - "id" : "Adam Russell", - "data" : [ - [ - "Perl", - 1 - ] - ], - "name" : "Adam Russell" - }, - { - "name" : "Arne Sommer", - "data" : [ - [ - "Perl", - 2 - ], - [ - "Raku", - 2 - ], - [ - "Blog", - 1 - ] - ], - "id" : "Arne Sommer" - }, - { - "data" : [ - [ - "Perl", - 2 - ], - [ - "Raku", - 2 - ] - ], - "id" : "Athanasius", - "name" : "Athanasius" - }, - { - "id" : "Ben Davies", - "data" : [ - [ - "Raku", - 1 - ] - ], - "name" : "Ben Davies" - }, - { - "name" : "Cheok-Yin Fung", - "data" : [ - [ - "Perl", - 2 - ], - [ - "Blog", - 1 - ] - ], - "id" : "Cheok-Yin Fung" - }, - { - "name" : "Colin Crain", - "data" : [ - [ - "Perl", - 2 - ], - [ - "Raku", - 2 - ], - [ - "Blog", - 1 - ] - ], - "id" : "Colin Crain" - }, - { - "name" : "Dave Jacoby", + "name" : "James Smith", "data" : [ [ "Perl", @@ -299,325 +60,8 @@ 1 ] ], - "id" : "Dave Jacoby" - }, - { - "id" : "Duncan C. White", - "data" : [ - [ - "Perl", - 2 - ] - ], - "name" : "Duncan C. White" - }, - { - "data" : [ - [ - "Perl", - 2 - ] - ], - "id" : "E. Choroba", - "name" : "E. Choroba" - }, - { - "name" : "Flavio Poletti", - "id" : "Flavio Poletti", - "data" : [ - [ - "Perl", - 2 - ], - [ - "Raku", - 2 - ], - [ - "Blog", - 2 - ] - ] - }, - { - "name" : "Ian Goodnight", - "id" : "Ian Goodnight", - "data" : [ - [ - "Perl", - 2 - ], - [ - "Blog", - 2 - ] - ] - }, - { - "name" : "Ivan Dimitrov", - "id" : "Ivan Dimitrov", - "data" : [ - [ - "Perl", - 2 - ] - ] - }, - { - "id" : "James Smith", - "data" : [ - [ - "Perl", - 2 - ], - [ - "Blog", - 1 - ] - ], - "name" : "James Smith" - }, - { - "data" : [ - [ - "Raku", - 2 - ] - ], - "id" : "Jan Krnavek", - "name" : "Jan Krnavek" - }, - { - "id" : "Jorg Sommrey", - "data" : [ - [ - "Perl", - 1 - ] - ], - "name" : "Jorg Sommrey" - }, - { - "id" : "Laurent Rosenfeld", - "data" : [ - [ - "Perl", - 1 - ], - [ - "Raku", - 1 - ], - [ - "Blog", - 1 - ] - ], - "name" : "Laurent Rosenfeld" - }, - { - "id" : "Lubos Kolouch", - "data" : [ - [ - "Perl", - 2 - ] - ], - "name" : "Lubos Kolouch" - }, - { - "name" : "Luca Ferrari", - "id" : "Luca Ferrari", - "data" : [ - [ - "Raku", - 2 - ], - [ - "Blog", - 2 - ] - ] - }, - { - "name" : "Mark Anderson", - "data" : [ - [ - "Raku", - 2 - ] - ], - "id" : "Mark Anderson" - }, - { - "id" : "Matthew Neleigh", - "data" : [ - [ - "Perl", - 2 - ] - ], - "name" : "Matthew Neleigh" - }, - { - "name" : "Mohammad S Anwar", - "id" : "Mohammad S Anwar", - "data" : [ - [ - "Perl", - 1 - ] - ] - }, - { - "data" : [ - [ - "Perl", - 2 - ] - ], - "id" : "Niels van Dijke", - "name" : "Niels van Dijke" - }, - { - "data" : [ - [ - "Perl", - 1 - ] - ], - "id" : "Olivier Delouya", - "name" : "Olivier Delouya" - }, - { - "name" : "Pete Houston", - "data" : [ - [ - "Perl", - 2 - ] - ], - "id" : "Pete Houston" - }, - { - "name" : "Peter Campbell Smith", - "id" : "Peter Campbell Smith", - "data" : [ - [ - "Perl", - 2 - ] - ] - }, - { - "name" : "Rich Snyder", - "data" : [ - [ - "Perl", - 2 - ] - ], - "id" : "Rich Snyder" - }, - { - "id" : "Roger Bell_West", - "data" : [ - [ - "Perl", - 2 - ], - [ - "Raku", - 2 - ], - [ - "Blog", - 1 - ] - ], - "name" : "Roger Bell_West" - }, - { - "id" : "Simon Green", - "data" : [ - [ - "Perl", - 2 - ], - [ - "Blog", - 1 - ] - ], - "name" : "Simon Green" - }, - { - "id" : "Simon Proctor", - "data" : [ - [ - "Raku", - 1 - ] - ], - "name" : "Simon Proctor" - }, - { - "name" : "Ulrich Rieke", - "id" : "Ulrich Rieke", - "data" : [ - [ - "Perl", - 2 - ], - [ - "Raku", - 2 - ] - ] - }, - { - "name" : "W. Luis Mochan", - "id" : "W. Luis Mochan", - "data" : [ - [ - "Perl", - 2 - ], - [ - "Blog", - 1 - ] - ] - }, - { - "name" : "Wanderdoc", - "id" : "Wanderdoc", - "data" : [ - [ - "Perl", - 2 - ] - ] + "id" : "James Smith" } ] - }, - "xAxis" : { - "type" : "category" - }, - "legend" : { - "enabled" : 0 - }, - "chart" : { - "type" : "column" - }, - "yAxis" : { - "title" : { - "text" : "Total Solutions" - } - }, - "tooltip" : { - "followPointer" : 1, - "pointFormat" : "{point.name}: {point.y:f}
", - "headerFormat" : "{series.name}
" } } diff --git a/stats/pwc-language-breakdown-summary.json b/stats/pwc-language-breakdown-summary.json index 87192bd2ba..4b2b19c8f5 100644 --- a/stats/pwc-language-breakdown-summary.json +++ b/stats/pwc-language-breakdown-summary.json @@ -1,24 +1,9 @@ { - "tooltip" : { - "pointFormat" : "{point.y:.0f}" - }, - "chart" : { - "type" : "column" - }, - "yAxis" : { - "min" : 0, - "title" : { - "text" : null - } - }, - "legend" : { - "enabled" : "false" - }, "xAxis" : { "labels" : { "style" : { - "fontFamily" : "Verdana, sans-serif", - "fontSize" : "13px" + "fontSize" : "13px", + "fontFamily" : "Verdana, sans-serif" } }, "type" : "category" @@ -26,38 +11,53 @@ "title" : { "text" : "The Weekly Challenge Contributions [2019 - 2021]" }, - "subtitle" : { - "text" : "Last updated at 2021-09-27 02:22:10 GMT" + "yAxis" : { + "title" : { + "text" : null + }, + "min" : 0 + }, + "tooltip" : { + "pointFormat" : "{point.y:.0f}" + }, + "chart" : { + "type" : "column" }, "series" : [ { + "name" : "Contributions", "dataLabels" : { - "enabled" : "true", - "format" : "{point.y:.0f}", + "rotation" : -90, "style" : { - "fontSize" : "13px", - "fontFamily" : "Verdana, sans-serif" + "fontFamily" : "Verdana, sans-serif", + "fontSize" : "13px" }, - "y" : 10, "align" : "right", "color" : "#FFFFFF", - "rotation" : -90 + "enabled" : "true", + "format" : "{point.y:.0f}", + "y" : 10 }, "data" : [ [ "Blog", - 1897 + 1898 ], [ "Perl", - 6262 + 6264 ], [ "Raku", 3842 ] - ], - "name" : "Contributions" + ] } - ] + ], + "subtitle" : { + "text" : "Last updated at 2021-09-27 14:54:37 GMT" + }, + "legend" : { + "enabled" : "false" + } } diff --git a/stats/pwc-language-breakdown.json b/stats/pwc-language-breakdown.json index 19192bfa82..1cd1d97126 100644 --- a/stats/pwc-language-breakdown.json +++ b/stats/pwc-language-breakdown.json @@ -1,685 +1,19 @@ { - "subtitle" : { - "text" : "Click the columns to drilldown the language breakdown. Last updated at 2021-09-27 02:22:10 GMT" + "title" : { + "text" : "The Weekly Challenge Language" }, - "series" : [ - { - "data" : [ - { - "y" : 161, - "name" : "#001", - "drilldown" : "001" - }, - { - "y" : 125, - "drilldown" : "002", - "name" : "#002" - }, - { - "y" : 81, - "drilldown" : "003", - "name" : "#003" - }, - { - "name" : "#004", - "drilldown" : "004", - "y" : 99 - }, - { - "drilldown" : "005", - "name" : "#005", - "y" : 78 - }, - { - "y" : 58, - "name" : "#006", - "drilldown" : "006" - }, - { - "y" : 64, - "name" : "#007", - "drilldown" : "007" - }, - { - "name" : "#008", - "drilldown" : "008", - "y" : 78 - }, - { - "drilldown" : "009", - "name" : "#009", - "y" : 76 - }, - { - "y" : 65, - "drilldown" : "010", - "name" : "#010" - }, - { - "y" : 85, - "drilldown" : "011", - "name" : "#011" - }, - { - "drilldown" : "012", - "name" : "#012", - "y" : 89 - }, - { - "drilldown" : "013", - "name" : "#013", - "y" : 85 - }, - { - "y" : 101, - "name" : "#014", - "drilldown" : "014" - }, - { - "y" : 99, - "drilldown" : "015", - "name" : "#015" - }, - { - "y" : 71, - "drilldown" : "016", - "name" : "#016" - }, - { - "name" : "#017", - "drilldown" : "017", - "y" : 84 - }, - { - "name" : "#018", - "drilldown" : "018", - "y" : 81 - }, - { - "drilldown" : "019", - "name" : "#019", - "y" : 103 - }, - { - "y" : 101, - "name" : "#020", - "drilldown" : "020" - }, - { - "name" : "#021", - "drilldown" : "021", - "y" : 72 - }, - { - "y" : 68, - "name" : "#022", - "drilldown" : "022" - }, - { - "y" : 97, - "drilldown" : "023", - "name" : "#023" - }, - { - "name" : "#024", - "drilldown" : "024", - "y" : 75 - }, - { - "name" : "#025", - "drilldown" : "025", - "y" : 59 - }, - { - "name" : "#026", - "drilldown" : "026", - "y" : 74 - }, - { - "y" : 60, - "drilldown" : "027", - "name" : "#027" - }, - { - "name" : "#028", - "drilldown" : "028", - "y" : 80 - }, - { - "y" : 79, - "name" : "#029", - "drilldown" : "029" - }, - { - "y" : 117, - "drilldown" : "030", - "name" : "#030" - }, - { - "y" : 89, - "drilldown" : "031", - "name" : "#031" - }, - { - "name" : "#032", - "drilldown" : "032", - "y" : 94 - }, - { - "y" : 110, - "drilldown" : "033", - "name" : "#033" - }, - { - "y" : 64, - "name" : "#034", - "drilldown" : "034" - }, - { - "y" : 64, - "drilldown" : "035", - "name" : "#035" - }, - { - "y" : 68, - "name" : "#036", - "drilldown" : "036" - }, - { - "y" : 67, - "name" : "#037", - "drilldown" : "037" - }, - { - "drilldown" : "038", - "name" : "#038", - "y" : 68 - }, - { - "y" : 62, - "name" : "#039", - "drilldown" : "039" - }, - { - "y" : 73, - "name" : "#040", - "drilldown" : "040" - }, - { - "y" : 76, - "name" : "#041", - "drilldown" : "041" - }, - { - "y" : 92, - "drilldown" : "042", - "name" : "#042" - }, - { - "y" : 68, - "name" : "#043", - "drilldown" : "043" - }, - { - "y" : 85, - "name" : "#044", - "drilldown" : "044" - }, - { - "drilldown" : "045", - "name" : "#045", - "y" : 96 - }, - { - "y" : 87, - "drilldown" : "046", - "name" : "#046" - }, - { - "drilldown" : "047", - "name" : "#047", - "y" : 84 - }, - { - "y" : 108, - "name" : "#048", - "drilldown" : "048" - }, - { - "y" : 89, - "name" : "#049", - "drilldown" : "049" - }, - { - "name" : "#050", - "drilldown" : "050", -