From 69e0cc9ea486dc62b815926b19c9a509ee0e8c69 Mon Sep 17 00:00:00 2001 From: Abigail Date: Mon, 30 Aug 2021 18:29:51 +0200 Subject: Tests for week 128 --- challenge-128/abigail/t/ctest.ini | 10 ++++++++++ challenge-128/abigail/t/input-1-1 | 3 +++ challenge-128/abigail/t/input-1-2 | 3 +++ challenge-128/abigail/t/input-2-1 | 2 ++ challenge-128/abigail/t/input-2-2 | 2 ++ challenge-128/abigail/t/output-1-1.exp | 3 +++ challenge-128/abigail/t/output-1-2.exp | 3 +++ challenge-128/abigail/t/output-2-1.exp | 1 + challenge-128/abigail/t/output-2-2.exp | 1 + 9 files changed, 28 insertions(+) create mode 100644 challenge-128/abigail/t/ctest.ini create mode 100644 challenge-128/abigail/t/input-1-1 create mode 100644 challenge-128/abigail/t/input-1-2 create mode 100644 challenge-128/abigail/t/input-2-1 create mode 100644 challenge-128/abigail/t/input-2-2 create mode 100644 challenge-128/abigail/t/output-1-1.exp create mode 100644 challenge-128/abigail/t/output-1-2.exp create mode 100644 challenge-128/abigail/t/output-2-1.exp create mode 100644 challenge-128/abigail/t/output-2-2.exp diff --git a/challenge-128/abigail/t/ctest.ini b/challenge-128/abigail/t/ctest.ini new file mode 100644 index 0000000000..23939dbaa9 --- /dev/null +++ b/challenge-128/abigail/t/ctest.ini @@ -0,0 +1,10 @@ +# +# Configuration file for running tests, using ctest. +# See https://github.com/Abigail/Misc/blob/master/ctest +# + +[names] +1-1 = Given Example 1 +1-2 = Given Example 2 +2-1 = Given Example 1 +2-2 = Given Example 2 diff --git a/challenge-128/abigail/t/input-1-1 b/challenge-128/abigail/t/input-1-1 new file mode 100644 index 0000000000..ff85c9f967 --- /dev/null +++ b/challenge-128/abigail/t/input-1-1 @@ -0,0 +1,3 @@ +1 0 0 0 1 0 +1 1 0 0 0 1 +1 0 0 0 0 0 diff --git a/challenge-128/abigail/t/input-1-2 b/challenge-128/abigail/t/input-1-2 new file mode 100644 index 0000000000..91776b27bc --- /dev/null +++ b/challenge-128/abigail/t/input-1-2 @@ -0,0 +1,3 @@ +0 0 1 1 +0 0 0 1 +0 0 1 0 diff --git a/challenge-128/abigail/t/input-2-1 b/challenge-128/abigail/t/input-2-1 new file mode 100644 index 0000000000..e19ab08173 --- /dev/null +++ b/challenge-128/abigail/t/input-2-1 @@ -0,0 +1,2 @@ +(11:20, 14:30) +(11:50, 15:00) diff --git a/challenge-128/abigail/t/input-2-2 b/challenge-128/abigail/t/input-2-2 new file mode 100644 index 0000000000..22433a47a9 --- /dev/null +++ b/challenge-128/abigail/t/input-2-2 @@ -0,0 +1,2 @@ +(10:20, 11:00, 11:10, 12:20, 16:20, 19:00) +(10:30, 13:20, 12:40, 12:50, 20:20, 21:20) diff --git a/challenge-128/abigail/t/output-1-1.exp b/challenge-128/abigail/t/output-1-1.exp new file mode 100644 index 0000000000..8f34313f74 --- /dev/null +++ b/challenge-128/abigail/t/output-1-1.exp @@ -0,0 +1,3 @@ +0 0 +0 0 +0 0 diff --git a/challenge-128/abigail/t/output-1-2.exp b/challenge-128/abigail/t/output-1-2.exp new file mode 100644 index 0000000000..8f34313f74 --- /dev/null +++ b/challenge-128/abigail/t/output-1-2.exp @@ -0,0 +1,3 @@ +0 0 +0 0 +0 0 diff --git a/challenge-128/abigail/t/output-2-1.exp b/challenge-128/abigail/t/output-2-1.exp new file mode 100644 index 0000000000..d00491fd7e --- /dev/null +++ b/challenge-128/abigail/t/output-2-1.exp @@ -0,0 +1 @@ +1 diff --git a/challenge-128/abigail/t/output-2-2.exp b/challenge-128/abigail/t/output-2-2.exp new file mode 100644 index 0000000000..00750edc07 --- /dev/null +++ b/challenge-128/abigail/t/output-2-2.exp @@ -0,0 +1 @@ +3 -- cgit From 8b213ac76eaa420d364233dc031edd05e15c3a3d Mon Sep 17 00:00:00 2001 From: Abigail Date: Mon, 30 Aug 2021 18:30:13 +0200 Subject: Perl solutions for week 128 --- challenge-128/abigail/perl/ch-1.pl | 73 +++++++++++++++++++++++++++++++++ challenge-128/abigail/perl/ch-2.pl | 83 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 156 insertions(+) create mode 100644 challenge-128/abigail/perl/ch-1.pl create mode 100644 challenge-128/abigail/perl/ch-2.pl diff --git a/challenge-128/abigail/perl/ch-1.pl b/challenge-128/abigail/perl/ch-1.pl new file mode 100644 index 0000000000..d80d72aaa5 --- /dev/null +++ b/challenge-128/abigail/perl/ch-1.pl @@ -0,0 +1,73 @@ +#!/opt/perl/bin/perl + +use 5.032; + +use strict; +use warnings; +no warnings 'syntax'; + +use experimental 'signatures'; +use experimental 'lexical_subs'; + +use FindBin; +use IPC::Open2; + +# +# See ../README.md +# + +# +# Run as: perl ch-1.pl < input-file +# + +# +# This is almost exactly the same as week 87, part 1, with two, trivial, +# differences: +# +# - In week 087, we wanted the largest rectangle containing 1s +# instead of 0s. +# - In week 087, a largest rectangle of '1x1' didn't count, +# and a 0 needed to be printed instead. +# + +# +# So, we will "solve" is challenge by just calling the solution +# of week 87, with some pre and post processing of the input +# and output: +# +# - We will swap the 0s and 1s in the input. +# - We'll replace any 1s in the output with 0s. (If the largest +# rectangle is a 1x1 rectangle, week 87 would return a 0 -- which +# *IS* a 1x1 rectangle...) +# + +# +# Note also that the first example is a bit misleading. It says the +# largest sub-matrix is: +# +# 0 0 0 +# 0 0 0 +# +# But that's only one of the largest. There is an equally large rectangle +# shaped like this: +# +# 0 0 +# 0 0 +# 0 0 +# +# (Someone really should start proofreading those challenges) +# + +my $program = "$FindBin::Bin/../../../challenge-087/abigail/perl/ch-2.pl"; + +my $pid = open2 (my $out, my $in, $^X, $program) // die "open failed: $!"; + +print $in y/01/10/r while <>; + +close $in; + +print y/1/0/r while <$out>; + +waitpid ($pid, 0); + +__END__ diff --git a/challenge-128/abigail/perl/ch-2.pl b/challenge-128/abigail/perl/ch-2.pl new file mode 100644 index 0000000000..5f3afee6b0 --- /dev/null +++ b/challenge-128/abigail/perl/ch-2.pl @@ -0,0 +1,83 @@ +#!/opt/perl/bin/perl + +use 5.032; + +use strict; +use warnings; +no warnings 'syntax'; + +use experimental 'signatures'; +use experimental 'lexical_subs'; + +use List::Util qw [max]; + +# +# See ../README.md +# + +# +# Run as: perl ch-2.pl < input-file +# +# The input is assumed to consist of two lines: the first with arrival +# times, the second one with departure times. +# + +# +# One way of solving this is to scan over the arrivals and departures, +# keeping a running count of platforms required, adding 1 for an arrival, +# and subtracting 1 for a departure. However, this requires the times +# to be sorted, and we are not given that the points are. Sorting would +# require Omega (N log N) time. +# +# Alternatively, we could put the times the trains are in the station +# in an interval tree, or a segment tree, and perform stabbing queries +# with each of the arrival points. But building either tree requires +# Omega (N log N) time. +# +# Instead, we will solve the problem in linear time, taking advantage +# there are only a fixed number of minutes in a day. We start with an +# array of 1440 (the number of minutes in a day) 0s. Then, for each +# train, we add 1 for each of the minutes the train stays at the station +# (if the departure time is before the arrival time, we assume the +# train is at the station during midnight, and use the appropriate minutes). +# If we have processed each train, we find the maximum in the array. +# +# This obviously only takes O (N) time. +# +# Assumptions: +# - If train A departures at time X, while train B arrives at time X, +# the cannot share the same platform. +# - There is minimum distance between trains; that is, if train A +# leaves a platform at time X, train B can arrive at the platform +# at time X + 1. +# - No two trains can share a platform. Either the platforms are +# short, or the trains are long. +# + +my @arrivals = map {[split /:/]} <> =~ /[0-9][0-9]:[0-9][0-9]/g; +my @departures = map {[split /:/]} <> =~ /[0-9][0-9]:[0-9][0-9]/g; + +my @trains = (0) x (24 * 60); + +foreach my $i (keys @arrivals) { + my $arrival = 60 * $arrivals [$i] [0] + $arrivals [$i] [1]; + my $departure = 60 * $departures [$i] [0] + $departures [$i] [1]; + my @minutes; + if ($arrival <= $departure) { + # + # Train arrives and leaves before midnight. + # + @minutes = $arrival .. $departure; + } + else { + # + # Train arrives before midnight, leaves after midnight. + # + @minutes = (0 .. $departure, $arrival .. (24 * 60 - 1)); + } + $trains [$_] ++ for @minutes; +} + +say max @trains; + +__END__ -- cgit From 4754fdce9596dea8d5a6694d698150254acbd36e Mon Sep 17 00:00:00 2001 From: Abigail Date: Mon, 30 Aug 2021 19:05:59 +0200 Subject: AWK solution for week 128, part 2 --- challenge-128/abigail/README.md | 91 ++++++++++++++++---------------------- challenge-128/abigail/awk/ch-2.awk | 55 +++++++++++++++++++++++ 2 files changed, 94 insertions(+), 52 deletions(-) create mode 100644 challenge-128/abigail/awk/ch-2.awk diff --git a/challenge-128/abigail/README.md b/challenge-128/abigail/README.md index 0c99f58d44..034d2135be 100644 --- a/challenge-128/abigail/README.md +++ b/challenge-128/abigail/README.md @@ -1,92 +1,79 @@ # Solutions by Abigail -## [Disjoint Sets][task1] +## [Maximum Sub-Matrix][task1] -> You are given two sets with unique integers. +> You are given m x n binary matrix having 0 or 1. > -> Write a script to figure out if they are disjoint. -> -> > The two sets are disjoint if they don't have any common members. +> Write a script to find out maximum sub-matrix having only 0 ### Examples ~~~~ -Input: @S1 = (1, 2, 5, 3, 4) - @S2 = (4, 6, 7, 8, 9) -~~~~ - -Output: `0` as the given two sets have common member `4`. +Input : [ 1 0 0 0 1 0 ] + [ 1 1 0 0 0 1 ] + [ 1 0 0 0 0 0 ] +Output: [ 0 0 0 ] + [ 0 0 0 ] ~~~~ -Input: @S1 = (1, 3, 5, 7, 9) - @S2 = (0, 2, 4, 6, 8) + ~~~~ +Input : [ 0 0 1 1 ] + [ 0 0 0 1 ] + [ 0 0 1 0 ] -Output: `1` as the given two sets do not have common member. +Output: [ 0 0 ] + [ 0 0 ] + [ 0 0 ] +~~~~ ### Solutions -* [AWK](awk/ch-1.awk) -* [Bash](bash/ch-1.sh) -* [C](c/ch-1.c) -* [Lua](lua/ch-1.lua) -* [Node.js](node/ch-1.js) * [Perl](perl/ch-1.pl) -* [Python](python/ch-1.py) -* [Ruby](ruby/ch-1.rb) ### Blog -[Perl Weekly Challenge 127: Disjoint Sets][blog1] +[Perl Weekly Challenge 128: Maximum Sub-Matrix][blog1] -## [Conflict Intervals][task2] +## [Minimum Platforms][task2] -> You are given a list of intervals. +> You are given two arrays of arrival and departure times of trains +> at a railway station. > -> Write a script to find out if the current interval conflicts with -> any of the previous intervals. +> Write a script to find out the minimum number of platforms needed +> so that no train needs to wait. ### Examples ~~~~ -Input: @Intervals = [(1,4), (3,5), (6,8), (12, 13), (3,20)] -Output: [(3,5), (3,20)] +Input: @arrivals = (11:20, 14:30) + @departutes = (11:50, 15:00) +Output: 1 ~~~~ -* The 1st interval `(1,4)` do not have any previous intervals to compare with, - so skip it. -* The 2nd interval `(3,5)` does conflict with previous interval (1,4). -* The 3rd interval `(6,8)` do not conflicts with any of the previous intervals - `(1,4)` and `(3,5)`, so skip it. -* The 4th interval `(12,13)` again do not conflicts with any of the previous - intervals `(1,4)`, `(3,5)` and `(6,8)`, so skip it. -* The 5th interval `(3,20)` conflicts with the first interval `(1,4)`. +The 1st arrival of train is at 11:20 and this is the only train at +the station, so you need 1 platform. Before the second arrival at +14:30, the first train left the station at 11:50, so you still need +only 1 platform. ~~~~ -Input: @Intervals = [(3,4), (5,7), (6,9), (10, 12), (13,15)] -Output: [(6,9)] +Input: @arrivals = (10:20, 11:00, 11:10, 12:20, 16:20, 19:00) + @departutes = (10:30, 13:20, 12:40, 12:50, 20:20, 21:20) +Output: 3 ~~~~ -* The 1st interval `(3,4)` do not have any previous intervals to compare with, - so skip it. -* The 2nd interval `(5,7)` do not conflicts with the previous interval `(3,4)`, - so skip it. -* The 3rd interval `(6,9)` does conflict with one of the previous - intervals `(5,7)`. -* The 4th interval `(10,12)` do not conflicts with any of the previous - intervals `(3,4)`, `(5,7)` and `(6,9)`, so skip it. -* The 5th interval `(13,15)` do not conflicts with any of the previous - intervals `(3,4)`, `(5,7)`, `(6,9)` and `(10,12)`, so skip it. +Between 11:00 and 12:20, there would be at least 3 trains at the +station, so we need minimum 3 platforms. ### Solutions * [AWK](awk/ch-2.awk) * [Perl](perl/ch-2.pl) ### Blog -[Perl Weekly Challenge 127: Conflict Intervals][blog2] +[Perl Weekly Challenge 128: Minimum Platforms][blog2] -[task1]: https://perlweeklychallenge.org/blog/perl-weekly-challenge-127/#TASK1 -[task2]: https://perlweeklychallenge.org/blog/perl-weekly-challenge-127/#TASK2 -[blog1]: https://abigail.github.io/HTML/Perl-Weekly-Challenge/week-127-1.html -[blog2]: https://abigail.github.io/HTML/Perl-Weekly-Challenge/week-127-2.html +[task1]: https://perlweeklychallenge.org/blog/perl-weekly-challenge-128/#TASK1 +[task2]: https://perlweeklychallenge.org/blog/perl-weekly-challenge-128/#TASK2 +[blog1]: https://abigail.github.io/HTML/Perl-Weekly-Challenge/week-128-1.html +[blog2]: https://abigail.github.io/HTML/Perl-Weekly-Challenge/week-128-2.html diff --git a/challenge-128/abigail/awk/ch-2.awk b/challenge-128/abigail/awk/ch-2.awk new file mode 100644 index 0000000000..7ce6c09fa8 --- /dev/null +++ b/challenge-128/abigail/awk/ch-2.awk @@ -0,0 +1,55 @@ +#!/usr/bin/awk + +# +# See ../README.md +# + +# +# Run as: awk -f ch-2.awk < input-file +# + + +BEGIN { + for (i = 0; i < 24 * 60; i ++) { + trains [i] = 0 + } +} + +NR <= 2 { + for (i = 1; i <= NF; i ++) { + gsub ("[^0-9:]", "", $i) + split ($i, chunks, ":") + minutes = 60 * chunks [1] + chunks [2] + if (NR == 1) { + arrivals [i] = minutes + } + else { + departures [i] = minutes + } + } +} + +END { + for (i = 1; i <= length (arrivals); i ++) { + if (arrivals [i] < departures [i]) { + for (minute = arrivals [i]; minute <= departures [i]; minute ++) { + trains [minute] ++ + } + } + else { + for (minute = 0; minute <= arrivals [i]; minute ++) { + trains [minute] ++ + } + for (minute = departures [i]; minute < 24 * 60; minute ++) { + trains [minute] ++ + } + } + } + max = 0 + for (i = 0; i < 24 * 60; i ++) { + if (max <= trains [i]) { + max = trains [i] + } + } + print max +} -- cgit From 83559ddd9bede17f2141bf98e61fd36f538a9e61 Mon Sep 17 00:00:00 2001 From: Abigail Date: Mon, 30 Aug 2021 19:57:50 +0200 Subject: C solution for week 128, part 2 --- challenge-128/abigail/README.md | 1 + challenge-128/abigail/c/ch-2.c | 106 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 107 insertions(+) create mode 100644 challenge-128/abigail/c/ch-2.c diff --git a/challenge-128/abigail/README.md b/challenge-128/abigail/README.md index 034d2135be..eb32303239 100644 --- a/challenge-128/abigail/README.md +++ b/challenge-128/abigail/README.md @@ -66,6 +66,7 @@ station, so we need minimum 3 platforms. ### Solutions * [AWK](awk/ch-2.awk) +* [C](awk/ch-2.c) * [Perl](perl/ch-2.pl) ### Blog diff --git a/challenge-128/abigail/c/ch-2.c b/challenge-128/abigail/c/ch-2.c new file mode 100644 index 0000000000..260fb60332 --- /dev/null +++ b/challenge-128/abigail/c/ch-2.c @@ -0,0 +1,106 @@ +# include +# include +# include + +/* + * See ../README.md + */ + +/* + * Run as: cc -o ch-2.o ch-2.c; ./ch-2.o < input-file + */ +# define MINUTES_PER_DAY 24 * 60 + +int main (void) { + char * arrival_line = NULL; + char * departure_line = NULL; + size_t a_len = 0; + size_t d_len = 0; + size_t a_str_len; + size_t d_str_len; + + if ((a_str_len = getline (&arrival_line, &a_len, stdin)) == -1) { + perror ("Failed to read arrival line"); + exit (1); + } + if ((d_str_len = getline (&departure_line, &d_len, stdin)) == -1) { + perror ("Failed to read departurerrival line"); + exit (1); + } + + /* + * Turn any non-digits into spaces. + */ + char * line_ptr = arrival_line; + while (* line_ptr) { + if (* line_ptr < '0' || * line_ptr > '9') { + * line_ptr = ' '; + } + line_ptr ++; + } + + line_ptr = departure_line; + while (* line_ptr) { + if (* line_ptr < '0' || * line_ptr > '9') { + * line_ptr = ' '; + } + line_ptr ++; + } + + /* + * Initialize the trains array: a counter for every minute in a day + */ + unsigned int trains [MINUTES_PER_DAY]; + for (size_t i = 0; i < MINUTES_PER_DAY; i ++) { + trains [i] = 0; + } + + /* + * Scan over the arrival/departure times + */ + int a_hour, a_minute, d_hour, d_minute; + int a_skip = 0; + int d_skip = 0; + char * a_ptr = arrival_line; + char * d_ptr = departure_line; + while (sscanf (a_ptr, "%d %d%n", &a_hour, &a_minute, &a_skip) == 2 && + sscanf (d_ptr, "%d %d%n", &d_hour, &d_minute, &d_skip) == 2) { + int arrival = a_hour * 60 + a_minute; + int departure = d_hour * 60 + d_minute; + a_ptr += a_skip; + d_ptr += d_skip; + + /* + * Count the number of trains there are in the station for each + * minute of the day + */ + for (int i = arrival; i <= departure; i ++) { + trains [i] ++; + } + if (departure < arrival) { + for (int i = 0; i <= departure; i ++) { + trains [i] ++; + } + for (int i = arrival; i < MINUTES_PER_DAY; i ++) { + trains [i] ++; + } + } + } + + /* + * Find the maximum number of trains + */ + int max = 0; + for (int i = 0; i < MINUTES_PER_DAY; i ++) { + if (max < trains [i]) { + max = trains [i]; + } + } + + printf ("%d\n", max); + + free (arrival_line); + free (departure_line); + + return (0); +} -- cgit From b3641076d24ab77f4e12016553ea64940b06d7fb Mon Sep 17 00:00:00 2001 From: Abigail Date: Mon, 30 Aug 2021 21:20:10 +0200 Subject: Lua solution for week 128, part 2 --- challenge-128/abigail/README.md | 1 + challenge-128/abigail/lua/ch-2.lua | 67 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 challenge-128/abigail/lua/ch-2.lua diff --git a/challenge-128/abigail/README.md b/challenge-128/abigail/README.md index eb32303239..8e0d5f27f7 100644 --- a/challenge-128/abigail/README.md +++ b/challenge-128/abigail/README.md @@ -67,6 +67,7 @@ station, so we need minimum 3 platforms. ### Solutions * [AWK](awk/ch-2.awk) * [C](awk/ch-2.c) +* [Lua](lua/ch-2.lua) * [Perl](perl/ch-2.pl) ### Blog diff --git a/challenge-128/abigail/lua/ch-2.lua b/challenge-128/abigail/lua/ch-2.lua new file mode 100644 index 0000000000..371e5991e4 --- /dev/null +++ b/challenge-128/abigail/lua/ch-2.lua @@ -0,0 +1,67 @@ +#!/opt/local/bin/lua + +-- +-- See ../README.md +-- + +-- +-- Run as: lua ch-1.lua < input-file +-- + + +-- +-- Read the input, and convert it to minutes (from midnight) +-- + +local arrivals = {} +local departures = {} + +for hour, minute in io . read ("*l") : gmatch ("([0-9][0-9]):([0-9][0-9])") do + arrivals [#arrivals + 1] = 60 * tonumber (hour) + tonumber (minute) +end +for hour, minute in io . read ("*l") : gmatch ("([0-9][0-9]):([0-9][0-9])") do + departures [#departures + 1] = 60 * tonumber (hour) + tonumber (minute) +end + +-- +-- Initialize the trains array, which counts the number of trains +-- in the station on each minute of the day. +-- +local trains = {} +for i = 0, 24 * 60 - 1 do + trains [i] = 0 +end + +-- +-- Process each train +-- +for i, arrival in ipairs (arrivals) do + local departure = departures [i] + if arrival < departure then + for i = arrival, departure do + trains [i] = trains [i] + 1 + end + else + for i = 0, arrival do + trains [i] = trains [i] + 1 + end + for i = departures, 24 * 60 - 1 do + trains [i] = trains [i] + 1 + end + end +end + +-- +-- Find the maximum +-- +local max = 0 +for i, count in ipairs (trains) do + if max < count then + max = count + end +end + +-- +-- And print it +-- +print (max) -- cgit From 5455918eaacbedcb68200bb86e140ba9d35f942a Mon Sep 17 00:00:00 2001 From: Abigail Date: Tue, 31 Aug 2021 14:19:54 +0200 Subject: Node.js solution for week 128, part 2 --- challenge-128/abigail/README.md | 1 + challenge-128/abigail/node/ch-2.js | 49 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 challenge-128/abigail/node/ch-2.js diff --git a/challenge-128/abigail/README.md b/challenge-128/abigail/README.md index 8e0d5f27f7..72a59e6317 100644 --- a/challenge-128/abigail/README.md +++ b/challenge-128/abigail/README.md @@ -68,6 +68,7 @@ station, so we need minimum 3 platforms. * [AWK](awk/ch-2.awk) * [C](awk/ch-2.c) * [Lua](lua/ch-2.lua) +* [Node.js](node/ch-2.js) * [Perl](perl/ch-2.pl) ### Blog diff --git a/challenge-128/abigail/node/ch-2.js b/challenge-128/abigail/node/ch-2.js new file mode 100644 index 0000000000..344cad59d5 --- /dev/null +++ b/challenge-128/abigail/node/ch-2.js @@ -0,0 +1,49 @@ +#!/usr/local/bin/node + +// +// See ../README.md +// + +// +// Run as: node ch-1.js < input-file +// + +let first_line = 1 +let arrivals = [] +let departures = [] + + require ('readline') +. createInterface ({input: process . stdin}) +. on ('line', line => { + let times = line . match (/[0-9][0-9]:[0-9][0-9]/g) + . map (_ => _ . split (/:/) . map (_ => +_)) + . map (_ => 60 * _ [0] + _ [1]) + if (first_line) { + arrivals = times + first_line = 0 + } + else { + departures = times + } +}) +. on ('close', () => { + let trains = [] + for (i = 0; i < 24 * 60; i ++) { + trains [i] = 0 + } + arrivals . forEach ((arrival, index) => { + let departure = departures [index] + for (i = arrival; i <= departure; i ++) { + trains [i] ++ + } + if (arrival > departure) { + for (i = 0; i <= departure; i ++) { + trains [i] ++ + } + for (i = arrival; i < 24 * 60; i ++) { + trains [i] ++ + } + } + }) + console . log (Math . max (... trains)) +}) -- cgit From 9c03140bf51d4dc8af3b6d6972b78b9c87994f14 Mon Sep 17 00:00:00 2001 From: Abigail Date: Tue, 31 Aug 2021 14:21:53 +0200 Subject: Fix arrival/departure order --- challenge-128/abigail/awk/ch-2.awk | 4 ++-- challenge-128/abigail/lua/ch-2.lua | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/challenge-128/abigail/awk/ch-2.awk b/challenge-128/abigail/awk/ch-2.awk index 7ce6c09fa8..0cad0ea91d 100644 --- a/challenge-128/abigail/awk/ch-2.awk +++ b/challenge-128/abigail/awk/ch-2.awk @@ -37,10 +37,10 @@ END { } } else { - for (minute = 0; minute <= arrivals [i]; minute ++) { + for (minute = 0; minute <= departures [i]; minute ++) { trains [minute] ++ } - for (minute = departures [i]; minute < 24 * 60; minute ++) { + for (minute = arrivals [i]; minute < 24 * 60; minute ++) { trains [minute] ++ } } diff --git a/challenge-128/abigail/lua/ch-2.lua b/challenge-128/abigail/lua/ch-2.lua index 371e5991e4..55045c8603 100644 --- a/challenge-128/abigail/lua/ch-2.lua +++ b/challenge-128/abigail/lua/ch-2.lua @@ -42,10 +42,10 @@ for i, arrival in ipairs (arrivals) do trains [i] = trains [i] + 1 end else - for i = 0, arrival do + for i = 0, departure do trains [i] = trains [i] + 1 end - for i = departures, 24 * 60 - 1 do + for i = arrival, 24 * 60 - 1 do trains [i] = trains [i] + 1 end end -- cgit From 7de13e7156e86949c2738bdea20bd19b001274f0 Mon Sep 17 00:00:00 2001 From: Abigail Date: Tue, 31 Aug 2021 14:26:44 +0200 Subject: Add additional test for week 128, part 2 --- challenge-128/abigail/t/ctest.ini | 1 + challenge-128/abigail/t/input-2-3 | 2 ++ challenge-128/abigail/t/output-2-3.exp | 1 + 3 files changed, 4 insertions(+) create mode 100644 challenge-128/abigail/t/input-2-3 create mode 100644 challenge-128/abigail/t/output-2-3.exp diff --git a/challenge-128/abigail/t/ctest.ini b/challenge-128/abigail/t/ctest.ini index 23939dbaa9..1968e87fdb 100644 --- a/challenge-128/abigail/t/ctest.ini +++ b/challenge-128/abigail/t/ctest.ini @@ -8,3 +8,4 @@ 1-2 = Given Example 2 2-1 = Given Example 1 2-2 = Given Example 2 +2-3 = Trains staying overnight diff --git a/challenge-128/abigail/t/input-2-3 b/challenge-128/abigail/t/input-2-3 new file mode 100644 index 0000000000..cce7d56878 --- /dev/null +++ b/challenge-128/abigail/t/input-2-3 @@ -0,0 +1,2 @@ +(10:20, 11:00, 11:10, 12:20, 16:20, 19:00, 05:00) +(10:30, 13:20, 12:40, 12:50, 20:20, 21:20, 04:00) diff --git a/challenge-128/abigail/t/output-2-3.exp b/challenge-128/abigail/t/output-2-3.exp new file mode 100644 index 0000000000..b8626c4cff --- /dev/null +++ b/challenge-128/abigail/t/output-2-3.exp @@ -0,0 +1 @@ +4 -- cgit From bf9cbb92e3f6535e5ddbfdad1a011a7ed3df43f8 Mon Sep 17 00:00:00 2001 From: Abigail Date: Tue, 31 Aug 2021 14:26:52 +0200 Subject: Fix reference --- challenge-128/abigail/lua/ch-2.lua | 2 +- challenge-128/abigail/node/ch-2.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/challenge-128/abigail/lua/ch-2.lua b/challenge-128/abigail/lua/ch-2.lua index 55045c8603..522cf76960 100644 --- a/challenge-128/abigail/lua/ch-2.lua +++ b/challenge-128/abigail/lua/ch-2.lua @@ -5,7 +5,7 @@ -- -- --- Run as: lua ch-1.lua < input-file +-- Run as: lua ch-2.lua < input-file -- diff --git a/challenge-128/abigail/node/ch-2.js b/challenge-128/abigail/node/ch-2.js index 344cad59d5..0f0987c00c 100644 --- a/challenge-128/abigail/node/ch-2.js +++ b/challenge-128/abigail/node/ch-2.js @@ -5,7 +5,7 @@ // // -// Run as: node ch-1.js < input-file +// Run as: node ch-2.js < input-file // let first_line = 1 -- cgit From fd9200a9334a1af11de67923d2dde2458e0b3180 Mon Sep 17 00:00:00 2001 From: Jörg Sommrey <28217714+jo-37@users.noreply.github.com> Date: Mon, 30 Aug 2021 16:34:50 +0200 Subject: Solution to task 1 --- challenge-128/jo-37/perl/ch-1.pl | 126 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100755 challenge-128/jo-37/perl/ch-1.pl diff --git a/challenge-128/jo-37/perl/ch-1.pl b/challenge-128/jo-37/perl/ch-1.pl new file mode 100755 index 0000000000..b4f6a02792 --- /dev/null +++ b/challenge-128/jo-37/perl/ch-1.pl @@ -0,0 +1,126 @@ +#!/usr/bin/perl -s + +use v5.16; +use PDL; +use Test2::V0 '!float'; +use experimental qw(signatures postderef); + +our ($tests, $examples); +$PDL::whichND = 's'; + +run_tests() if $tests || $examples; # does not return + +die <@*); + + +### Implementation + +# Loop over all sub matrix dimensions in descending size down from the +# given matrix' dimensions and stop at the first all-zero sub matrix +# hit. +sub zero_submatrix ($m) { + # The loop variable is a 1-d index piddle holding the sub matrix + # dimensions. + for my $dims (sort {prod($b) <=> prod($a)} + (ndcoords(indx, $m)->clump(1, 2) + 1)->dog) { + # Build "array ref syntax" slice arguments such that a sub + # matrix of the current dimensions having an upper left + # element inside the resulting slice fits into the full + # matrix, i.e. a "PDL way" to get [[0, -dim0], [0, -dim1]] + # from [dim0, dim1] + my $slice = indx(0, 0)->cat(-$dims)->xchg(1, 0)->unpdl; + # Select all sub matrices in the current dimensions having a + # zero as the upper left element, take the logical "or" over + # the values therein and return the current dimensions as an + # array ref if there is an all-zero sub matrix. + return $dims->unpdl if !all + $m->range(whichND(!$m->slice(@$slice)), $dims) + ->reorder(1, 2, 0)->orover->orover; + } + return [0, 0]; +} + + +### Examples and tests + +sub run_tests { + SKIP: { + skip "examples" unless $examples; + + # 2x3 and 3x2 are both valid. + like zero_submatrix(byte( + [1, 0, 0, 0, 1, 0], + [1, 1, 0, 0, 0, 1], + [1, 0, 0, 0, 0, 0])), + bag {item 2; item 3; end;}, 'example 1'; + is zero_submatrix(byte( + [0, 0, 1, 1], + [0, 0, 0, 1], + [0, 0, 1, 0])), [2, 3], 'example 2'; + } + + SKIP: { + skip "tests" unless $tests; + + like zero_submatrix(byte( + [1, 0, 0, 0, 0, 0], + [1, 1, 0, 0, 1, 0], + [1, 0, 0, 0, 0, 0])), + [2, 3], 'like example 1, forced to 2x3'; + is zero_submatrix(byte( + [1, 1], + [1, 1])), [0, 0], 'no zero'; + is zero_submatrix(byte( + [1, 0], + [1, 1])), [1, 1], 'single zero'; + is zero_submatrix(byte( + [0, 0], + [0, 0], + [0, 0])), [2, 3], 'full size'; + is zero_submatrix(byte( + [0, 0, 0], + [0, 0, 1], + [0, 0, 0], + [0, 1, 0])), [2, 3], 'upper left'; + is zero_submatrix(byte( + [0, 0, 0], + [1, 0, 0], + [0, 0, 0], + [0, 1, 0])), [2, 3], 'upper right'; + is zero_submatrix(byte( + [0, 1, 0], + [0, 0, 0], + [0, 0, 1], + [0, 0, 0])), [2, 3], 'lower left'; + is zero_submatrix(byte( + [0, 1, 0], + [0, 0, 0], + [1, 0, 0], + [0, 0, 0])), [2, 3], 'lower right'; + } + + done_testing; + exit; +} -- cgit From d8fae692ac658a6812c803605b83c650188fccbc Mon Sep 17 00:00:00 2001 From: Jörg Sommrey <28217714+jo-37@users.noreply.github.com> Date: Mon, 30 Aug 2021 11:51:57 +0200 Subject: Solution to task 2 --- challenge-128/jo-37/perl/ch-2.pl | 79 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100755 challenge-128/jo-37/perl/ch-2.pl diff --git a/challenge-128/jo-37/perl/ch-2.pl b/challenge-128/jo-37/perl/ch-2.pl new file mode 100755 index 0000000000..62f101d10b --- /dev/null +++ b/challenge-128/jo-37/perl/ch-2.pl @@ -0,0 +1,79 @@ +#!/usr/bin/perl -s + +use v5.16; +use Test2::V0; +use List::Util 'reduce'; +use experimental 'signatures'; + +our ($tests, $examples); + +run_tests() if $tests || $examples; # does not return + +die <[($a->[1] += $b->[1]) > $a->[0]], $a->[1]]} + ['-inf', 0], sort {$a->[0] <=> $b->[0] || $b->[1] <=> $a->[1]} + map {$_->[0] =~ tr/://d; $_} + map([$_, 1], @$arrivals), map([$_, -1], @$departures))->[0]; +} + + +### Examples and tests + +sub run_tests { + SKIP: { + skip "examples" unless $examples; + is platforms([qw(11:20 14:30)], [qw(11:50 15:00)]), 1, 'example 1'; + is platforms([qw(10:20 11:00 11:10 12:20 16:20 19:00)], + [qw(10:30 13:20 12:40 12:50 20:20 21:20)]), 3, 'example 2'; + } + + SKIP: { + skip "tests" unless $tests; + is platforms([qw(9:30 10:00)], [qw(10:15 10:30)]), 2, 'one digit hour'; + is platforms([qw(09:30 10:00)], [qw(10:15 10:30)]), 2, 'leading zero'; + is platforms([qw(1:00 1:10)], [qw(1:10 1:20)]), 2, + 'no simultaneous arrival and departure at the same platform'; + } + + done_testing; + exit; +} -- cgit From 2be9b3a38f2e4a1089b8f06ca530d946e04c3e21 Mon Sep 17 00:00:00 2001 From: Roger Bell_West Date: Fri, 3 Sep 2021 09:44:51 +0100 Subject: Blog post for challenge #128 --- challenge-128/roger-bell-west/blog.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 challenge-128/roger-bell-west/blog.txt diff --git a/challenge-128/roger-bell-west/blog.txt b/challenge-128/roger-bell-west/blog.txt new file mode 100644 index 0000000000..f29be86f4a --- /dev/null +++ b/challenge-128/roger-bell-west/blog.txt @@ -0,0 +1 @@ +https://blog.firedrake.org/archive/2021/09/Perl_Weekly_Challenge_128__Maxima_and_Minima.html -- cgit From ffb686ede944c75327142ed85244a414a6a615fd Mon Sep 17 00:00:00 2001 From: Mohammad S Anwar Date: Fri, 3 Sep 2021 10:55:12 +0100 Subject: - Added solutions by Jorg Sommrey. --- stats/pwc-current.json | 237 ++++---- stats/pwc-language-breakdown-summary.json | 82 +-- stats/pwc-language-breakdown.json | 970 +++++++++++++++--------------- stats/pwc-leaders.json | 400 ++++++------ stats/pwc-summary-1-30.json | 120 ++-- stats/pwc-summary-121-150.json | 36 +- stats/pwc-summary-151-180.json | 98 +-- stats/pwc-summary-181-210.json | 40 +- stats/pwc-summary-211-240.json | 44 +- stats/pwc-summary-31-60.json | 44 +- stats/pwc-summary-61-90.json | 98 +-- stats/pwc-summary-91-120.json | 42 +- stats/pwc-summary.json | 42 +- 13 files changed, 1134 insertions(+), 1119 deletions(-) diff --git a/stats/pwc-current.json b/stats/pwc-current.json index a14982a0bd..b5743df994 100644 --- a/stats/pwc-current.json +++ b/stats/pwc-current.json @@ -1,29 +1,83 @@ { - "xAxis" : { - "type" : "category" - }, - "plotOptions" : { - "series" : { - "borderWidth" : 0, - "dataLabels" : { - "format" : "{point.y}", - "enabled" : 1 - } + "series" : [ + { + "data" : [ + { + "y" : 3, + "name" : "Dave Jacoby", + "drilldown" : "Dave Jacoby" + }, + { + "drilldown" : "E. Choroba", + "y" : 2, + "name" : "E. Choroba" + }, + { + "drilldown" : "Flavio Poletti", + "name" : "Flavio Poletti", + "y" : 6 + }, + { + "drilldown" : "James Smith", + "name" : "James Smith", + "y" : 3 + }, + { + "drilldown" : "Jorg Sommrey", + "y" : 2, + "name" : "Jorg Sommrey" + }, + { + "y" : 4, + "name" : "Luca Ferrari", + "drilldown" : "Luca Ferrari" + }, + { + "drilldown" : "Mark Anderson", + "name" : "Mark Anderson", + "y" : 2 + }, + { + "drilldown" : "Peter Campbell Smith", + "name" : "Peter Campbell Smith", + "y" : 1 + }, + { + "drilldown" : "Roger Bell_West", + "y" : 4, + "name" : "Roger Bell_West" + }, + { + "name" : "Simon Green", + "y" : 3, + "drilldown" : "Simon Green" + }, + { + "y" : 4, + "name" : "Stuart Little", + "drilldown" : "Stuart Little" + }, + { + "y" : 2, + "name" : "Ulrich Rieke", + "drilldown" : "Ulrich Rieke" + }, + { + "drilldown" : "W. Luis Mochan", + "y" : 3, + "name" : "W. Luis Mochan" + } + ], + "name" : "The Weekly Challenge - 128", + "colorByPoint" : 1 } - }, - "chart" : { - "type" : "column" - }, - "title" : { - "text" : "The Weekly Challenge - 128" - }, + ], "subtitle" : { - "text" : "[Champions: 12] Last updated at 2021-09-02 15:46:00 GMT" + "text" : "[Champions: 13] Last updated at 2021-09-03 09:54:10 GMT" }, "drilldown" : { "series" : [ { - "name" : "Dave Jacoby", "data" : [ [ "Perl", @@ -34,20 +88,20 @@ 1 ] ], - "id" : "Dave Jacoby" + "id" : "Dave Jacoby", + "name" : "Dave Jacoby" }, { + "id" : "E. Choroba", + "name" : "E. Choroba", "data" : [ [ "Perl", 2 ] - ], - "id" : "E. Choroba", - "name" : "E. Choroba" + ] }, { - "id" : "Flavio Poletti", "data" : [ [ "Perl", @@ -62,10 +116,10 @@ 2 ] ], + "id" : "Flavio Poletti", "name" : "Flavio Poletti" }, { - "id" : "James Smith", "data" : [ [ "Perl", @@ -76,10 +130,20 @@ 1 ] ], + "id" : "James Smith", "name" : "James Smith" }, { - "id" : "Luca Ferrari", + "data" : [ + [ + "Perl", + 2 + ] + ], + "name" : "Jorg Sommrey", + "id" : "Jorg Sommrey" + }, + { "data" : [ [ "Raku", @@ -90,30 +154,32 @@ 2 ] ], + "id" : "Luca Ferrari", "name" : "Luca Ferrari" }, { + "id" : "Mark Anderson", "name" : "Mark Anderson", "data" : [ [ "Raku", 2 ] - ], - "id" : "Mark Anderson" + ] }, { - "id" : "Peter Campbell Smith", "data" : [ [ "Perl", 1 ] ], - "name" : "Peter Campbell Smith" + "name" : "Peter Campbell Smith", + "id" : "Peter Campbell Smith" }, { "id" : "Roger Bell_West", + "name" : "Roger Bell_West", "data" : [ [ "Perl", @@ -123,11 +189,9 @@ "Raku", 2 ] - ], - "name" : "Roger Bell_West" + ] }, { - "name" : "Simon Green", "data" : [ [ "Perl", @@ -138,6 +202,7 @@ 1 ] ], + "name" : "Simon Green", "id" : "Simon Green" }, { @@ -151,11 +216,10 @@ 2 ] ], - "id" : "Stuart Little", - "name" : "Stuart Little" + "name" : "Stuart Little", + "id" : "Stuart Little" }, { - "id" : "Ulrich Rieke", "data" : [ [ "Perl", @@ -166,9 +230,11 @@ 1 ] ], + "id" : "Ulrich Rieke", "name" : "Ulrich Rieke" }, { + "name" : "W. Luis Mochan", "id" : "W. Luis Mochan", "data" : [ [ @@ -179,90 +245,39 @@ "Blog", 1 ] - ], - "name" : "W. Luis Mochan" + ] } ] }, + "xAxis" : { + "type" : "category" + }, + "chart" : { + "type" : "column" + }, + "tooltip" : { + "followPointer" : 1, + "pointFormat" : "{point.name}: {point.y:f}
", + "headerFormat" : "{series.name}
" + }, + "plotOptions" : { + "series" : { + "borderWidth" : 0, + "dataLabels" : { + "enabled" : 1, + "format" : "{point.y}" + } + } + }, "legend" : { "enabled" : 0 }, + "title" : { + "text" : "The Weekly Challenge - 128" + }, "yAxis" : { "title" : { "text" : "Total Solutions" } - }, - "series" : [ - { - "name" : "The Weekly Challenge - 128", - "colorByPoint" : 1, - "data" : [ - { - "drilldown" : "Dave Jacoby", - "y" : 3, - "name" : "Dave Jacoby" - }, - { - "name" : "E. Choroba", - "drilldown" : "E. Choroba", - "y" : 2 - }, - { - "drilldown" : "Flavio Poletti", - "y" : 6, - "name" : "Flavio Poletti" - }, - { - "name" : "James Smith", - "y" : 3, - "drilldown" : "James Smith" - }, - { - "y" : 4, - "drilldown" : "Luca Ferrari", - "name" : "Luca Ferrari" - }, - { - "name" : "Mark Anderson", - "y" : 2, - "drilldown" : "Mark Anderson" - }, - { - "drilldown" : "Peter Campbell Smith", - "y" : 1, - "name" : "Peter Campbell Smith" - }, - { - "y" : 4, - "drilldown" : "Roger Bell_West", - "name" : "Roger Bell_West" - }, - { - "y" : 3, - "drilldown" : "Simon Green", - "name" : "Simon Green" - }, - { - "name" : "Stuart Little", - "drilldown" : "Stuart Little", - "y" : 4 - }, - { - "drilldown" : "Ulrich Rieke", - "y" : 2, - "name" : "Ulrich Rieke" - }, - { - "name" : "W. Luis Mochan", - "drilldown" : "W. Luis Mochan", - "y" : 3 - } - ] - } - ], - "tooltip" : { - "pointFormat" : "{point.name}: {point.y:f}
", - "headerFormat" : "{series.name}
", - "followPointer" : 1 } } diff --git a/stats/pwc-language-breakdown-summary.json b/stats/pwc-language-breakdown-summary.json index 46b09f62a7..bf0c968883 100644 --- a/stats/pwc-language-breakdown-summary.json +++ b/stats/pwc-language-breakdown-summary.json @@ -1,9 +1,45 @@ { - "tooltip" : { - "pointFormat" : "{point.y:.0f}" + "legend" : { + "enabled" : "false" + }, + "title" : { + "text" : "The Weekly Challenge Contributions [2019 - 2021]" + }, + "yAxis" : { + "title" : { + "text" : null + }, + "min" : 0 + }, + "xAxis" : { + "labels" : { + "style" : { + "fontFamily" : "Verdana, sans-serif", + "fontSize" : "13px" + } + }, + "type" : "category" + }, + "chart" : { + "type" : "column" + }, + "subtitle" : { + "text" : "Last updated at 2021-09-03 09:54:09 GMT" }, "series" : [ { + "dataLabels" : { + "format" : "{point.y:.0f}", + "enabled" : "true", + "style" : { + "fontFamily" : "Verdana, sans-serif", + "fontSize" : "13px" + }, + "color" : "#FFFFFF", + "align" : "right", + "rotation" : -90, + "y" : 10 + }, "data" : [ [ "Blog", @@ -11,53 +47,17 @@ ], [ "Perl", - 6129 + 6131 ], [ "Raku", 3788 ] ], - "dataLabels" : { - "color" : "#FFFFFF", - "style" : { - "fontSize" : "13px", - "fontFamily" : "Verdana, sans-serif" - }, - "rotation" : -90, - "enabled" : "true", - "align" : "right", - "format" : "{point.y:.0f}", - "y" : 10 - }, "name" : "Contributions" } ], - "yAxis" : { - "title" : { - "text" : null - }, - "min" : 0 - }, - "legend" : { - "enabled" : "false" - }, - "subtitle" : { - "text" : "Last updated at 2021-09-02 15:46:00 GMT" - }, - "title" : { - "text" : "The Weekly Challenge Contributions [2019 - 2021]" - }, - "chart" : { - "type" : "column" - }, - "xAxis" : { - "labels" : { - "style" : { - "fontSize" : "13px", - "fontFamily" : "Verdana, sans-serif" - } - }, - "type" : "category" + "tooltip" : { + "pointFormat" : "{point.y:.0f}" } } diff --git a/stats/pwc-language-breakdown.json b/stats/pwc-language-breakdown.json index ca0fa9586c..ac468ccba8 100644 --- a/stats/pwc-language-breakdown.json +++ b/stats/pwc-language-breakdown.json @@ -1,11 +1,18 @@ { - "subtitle" : { - "text" : "Click the columns to drilldown the language breakdown. Last updated at 2021-09-02 15:46:00 GMT" + "legend" : { + "enabled" : "false" + }, + "title" : { + "text" : "The Weekly Challenge Language" + }, + "yAxis" : { + "title" : { + "text" : "Total Solutions" + } }, "drilldown" : { "series" : [ { - "name" : "001", "data" : [ [ "Perl", @@ -20,10 +27,12 @@ 11 ] ], + "name" : "001", "id" : "001" }, { "id" : "002", + "name" : "002", "data" : [ [ "Perl", @@ -37,10 +46,10 @@ "Blog", 10 ] - ], - "name" : "002" + ] }, { + "name" : "003", "id" : "003", "data" : [ [ @@ -55,11 +64,9 @@ "Blog", 9 ] - ], - "name" : "003" + ] }, { - "name" : "004", "data" : [ [ "Perl", @@ -74,7 +81,8 @@ 10 ] ], - "id" : "004" + "id" : "004", + "name" : "004" }, { "data" : [ @@ -91,8 +99,8 @@ 12 ] ], - "id" : "005", - "name" : "005" + "name" : "005", + "id" : "005" }, { "data" : [ @@ -109,11 +117,10 @@ 7 ] ], - "id" : "006", - "name" : "006" + "name" : "006", + "id" : "006" }, { - "id" : "007", "data" : [ [ "Perl", @@ -128,9 +135,11 @@ 10 ] ], + "id" : "007", "name" : "007" }, { + "name" : "008", "id" : "008", "data" : [ [ @@ -145,11 +154,9 @@ "Blog", 12 ] - ], - "name" : "008" + ] }, { - "name" : "009", "data" : [ [ "Perl", @@ -164,6 +171,7 @@ 13 ] ], + "name" : "009", "id" : "009" }, { @@ -181,10 +189,11 @@ 11 ] ], - "id" : "010", - "name" : "010" + "name" : "010", + "id" : "010" }, { + "name" : "011", "id" : "011", "data" : [ [ @@ -199,8 +208,7 @@ "Blog", 10 ] - ], - "name" : "011" + ] }, { "data" : [ @@ -217,11 +225,10 @@ 11 ] ], - "id" : "012", - "name" : "012" + "name" : "012", + "id" : "012" }, { - "name" : "013", "data" : [ [ "Perl", @@ -236,6 +243,7 @@ 13 ] ], + "name" : "013", "id" : "013" }, { @@ -257,8 +265,8 @@ "name" : "014" }, { - "name" : "015", "id" : "015", + "name" : "015", "data" : [ [ "Perl", @@ -275,7 +283,6 @@ ] }, { - "id" : "016", "data" : [ [ "Perl", @@ -290,10 +297,10 @@ 12 ] ], + "id" : "016", "name" : "016" }, { - "name" : "017", "data" : [ [ "Perl", @@ -308,10 +315,10 @@ 12 ] ], - "id" : "017" + "id" : "017", + "name" : "017" }, { - "name" : "018", "data" : [ [ "Perl", @@ -326,10 +333,10 @@ 14 ] ], + "name" : "018", "id" : "018" }, { - "name" : "019", "data" : [ [ "Perl", @@ -344,9 +351,12 @@ 13 ] ], - "id" : "019" + "id" : "019", + "name" : "019" }, { + "name" : "020", + "id" : "020", "data" : [ [ "Perl", @@ -360,13 +370,9 @@ "Blog", 13 ] - ], - "id" : "020", - "name" : "020" + ] }, { - "name" : "021", - "id" : "021", "data" : [ [ "Perl", @@ -380,11 +386,11 @@ "Blog", 10 ] - ] + ], + "name" : "021", + "id" : "021" }, { - "name" : "022", - "id" : "022", "data" : [ [ "Perl", @@ -398,7 +404,9 @@ "Blog", 10 ] - ] + ], + "name" : "022", + "id" : "022" }, { "data" : [ @@ -420,6 +428,7 @@ }, { "name" : "024", + "id" : "024", "data" : [ [ "Perl", @@ -433,10 +442,11 @@ "Blog", 11 ] - ], - "id" : "024" + ] }, { + "id" : "025", + "name" : "025", "data" : [ [ "Perl", @@ -450,11 +460,11 @@ "Blog", 12 ] - ], - "id" : "025", - "name" : "025" + ] }, { + "name" : "026", + "id" : "026", "data" : [ [ "Perl", @@ -468,12 +478,11 @@ "Blog", 10 ] - ], - "id" : "026", - "name" : "026" + ] }, { "id" : "027", + "name" : "027", "data" : [ [ "Perl", @@ -487,12 +496,9 @@ "Blog", 9 ] - ], - "name" : "027" + ] }, { - "name" : "028", - "id" : "028", "data" : [ [ "Perl", @@ -506,11 +512,11 @@ "Blog", 9 ] - ] + ], + "id" : "028", + "name" : "028" }, { - "name" : "029", - "id" : "029", "data" : [ [ "Perl", @@ -524,10 +530,13 @@ "Blog", 12 ] - ] + ], + "name" : "029", + "id" : "029" }, { "name" : "030", + "id" : "030", "data" : [ [ "Perl", @@ -541,10 +550,10 @@ "Blog", 10 ] - ], - "id" : "030" + ] }, { + "name" : "031", "id" : "031", "data" : [ [ @@ -559,11 +568,9 @@ "Blog", 9 ] - ], - "name" : "031" + ] }, { - "id" : "032", "data" : [ [ "Perl", @@ -578,9 +585,11 @@ 10 ] ], - "name" : "032" + "name" : "032", + "id" : "032" }, { + "id" : "033", "name" : "033", "data" : [ [ @@ -595,12 +604,9 @@ "Blog", 10 ] - ], - "id" : "033" + ] }, { - "name" : "034", - "id" : "034", "data" : [ [ "Perl", @@ -614,11 +620,11 @@ "Blog", 11 ] - ] + ], + "id" : "034", + "name" : "034" }, { - "name" : "035", - "id" : "035", "data" : [ [ "Perl", @@ -632,10 +638,11 @@ "Blog", 9 ] - ] + ], + "id" : "035", + "name" : "035" }, { - "name" : "036", "data" : [ [ "Perl", @@ -650,9 +657,11 @@ 11 ] ], - "id" : "036" + "id" : "036", + "name" : "036" }, { + "id" : "037", "name" : "037", "data" : [ [ @@ -667,11 +676,9 @@ "Blog", 9 ] - ], - "id" : "037" + ] }, { - "name" : "038", "data" : [ [ "Perl", @@ -686,10 +693,12 @@ 12 ] ], + "name" : "038", "id" : "038" }, { "id" : "039", + "name" : "039", "data" : [ [ "Perl", @@ -703,10 +712,10 @@ "Blog", 12 ] - ], - "name" : "039" + ] }, { + "name" : "040", "id" : "040", "data" : [ [ @@ -721,8 +730,7 @@ "Blog", 10 ] - ], - "name" : "040" + ] }, { "data" : [ @@ -739,10 +747,12 @@ 9 ] ], - "id" : "041", - "name" : "041" + "name" : "041", + "id" : "041" }, { + "name" : "042", + "id" : "042", "data" : [ [ "Perl", @@ -756,9 +766,7 @@ "Blog", 11 ] - ], - "id" : "042", - "name" : "042" + ] }, { "name" : "043", @@ -779,7 +787,6 @@ ] }, { - "name" : "044", "data" : [ [ "Perl", @@ -794,9 +801,11 @@ 11 ] ], + "name" : "044", "id" : "044" }, { + "id" : "045", "name" : "045", "data" : [ [ @@ -811,11 +820,11 @@ "Blog", 11 ] - ], - "id" : "045" + ] }, { "name" : "046", + "id" : "046", "data" : [ [ "Perl", @@ -829,12 +838,9 @@ "Blog", 10 ] - ], - "id" : "046" + ] }, { - "name" : "047", - "id" : "047", "data" : [ [ "Perl", @@ -848,11 +854,11 @@ "Blog", 10 ] - ] + ], + "name" : "047", + "id" : "047" }, { - "name" : "048", - "id" : "048", "data" : [ [ "Perl", @@ -866,9 +872,13 @@ "Blog", 12 ] - ] + ], + "name" : "048", + "id" : "048" }, { + "name" : "049", + "id" : "049", "data" : [ [ "Perl", @@ -882,9 +892,7 @@ "Blog", 12 ] - ], - "id" : "049", - "name" : "049" + ] }, { "data" : [ @@ -919,11 +927,12 @@ 11 ] ], - "id" : "051", - "name" : "051" + "name" : "051", + "id" : "051" }, { "name" : "052", + "id" : "052", "data" : [ [ "Perl", @@ -937,8 +946,7 @@ "Blog", 14 ] - ], - "id" : "052" + ] }, { "name" : "053", @@ -959,8 +967,6 @@ ] }, { - "name" : "054", - "id" : "054", "data" : [ [ "Perl", @@ -974,9 +980,13 @@ "Blog", 18 ] - ] + ], + "name" : "054", + "id" : "054" }, { + "id" : "055", + "name" : "055", "data" : [ [ "Perl", @@ -990,11 +1000,10 @@ "Blog", 14 ] - ], - "id" : "055", - "name" : "055" + ] }, { + "id" : "056", "name" : "056", "data" : [ [ @@ -1009,10 +1018,11 @@ "Blog", 16 ] - ], - "id" : "056" + ] }, { + "name" : "057", + "id" : "057", "data" : [ [ "Perl", @@ -1026,12 +1036,11 @@ "Blog", 15 ] - ], - "id" : "057", - "name" : "057" + ] }, { "name" : "058", + "id" : "058", "data" : [ [ "Perl", @@ -1045,11 +1054,9 @@ "Blog", 13 ] - ], - "id" : "058" + ] }, { - "id" : "059", "data" : [ [ "Perl", @@ -1064,11 +1071,10 @@ 16 ] ], - "name" : "059" + "name" : "059", + "id" : "059" }, { - "name" : "060", - "id" : "060", "data" : [ [ "Perl", @@ -1082,7 +1088,9 @@ "Blog", 16 ] - ] + ], + "name" : "060", + "id" : "060" }, { "name" : "061", @@ -1103,6 +1111,8 @@ ] }, { + "name" : "062", + "id" : "062", "data" : [ [ "Perl", @@ -1116,12 +1126,9 @@ "Blog", 11 ] - ], - "id" : "062", - "name" : "062" + ] }, { - "id" : "063", "data" : [ [ "Perl", @@ -1136,11 +1143,12 @@ 13 ] ], + "id" : "063", "name" : "063" }, { - "name" : "064", "id" : "064", + "name" : "064",