-
-
Save solson/410ee20f210d17f1b663d0d55e3d81ec to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> my %directors; %directors{$_}++ for $j<seen>.map(|*<directors>) | |
Nil | |
> printf "%-20s %s\n", $_.key, $_.value for %directors.sort(-*.value)[^10] | |
Steven Spielberg 11 | |
Hayao Miyazaki 10 | |
Christopher Nolan 7 | |
Peter Jackson 6 | |
Wes Anderson 5 | |
Darren Aronofsky 5 | |
George Miller 5 | |
Robert Zemeckis 5 | |
Adam McKay 4 | |
The Wachowskis 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> printf "%-20s %s\n", $_.key, $_.value for Bag.new($j<seen>.map(|*<directors>)).sort(-*.value)[^10] | |
Steven Spielberg 11 | |
Hayao Miyazaki 10 | |
Christopher Nolan 7 | |
Peter Jackson 6 | |
Wes Anderson 5 | |
Robert Zemeckis 5 | |
Darren Aronofsky 5 | |
George Miller 5 | |
Rob Reiner 4 | |
David Fincher 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> printf "%-20s %s\n", .key, .value for Bag.new($j<seen>.map(|*<directors>)).sort({ -.value, .key })[^10] | |
Steven Spielberg 11 | |
Hayao Miyazaki 10 | |
Christopher Nolan 7 | |
Peter Jackson 6 | |
Darren Aronofsky 5 | |
George Miller 5 | |
Robert Zemeckis 5 | |
Wes Anderson 5 | |
Adam McKay 4 | |
Andrew Adamson 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> printf "%-20s %s\n", .key, .value for %movies<seen>.map(|*<directors>).Bag.sort({ -.value, .key })[^10] | |
Steven Spielberg 11 | |
Hayao Miyazaki 10 | |
Christopher Nolan 7 | |
Peter Jackson 6 | |
Darren Aronofsky 5 | |
George Miller 5 | |
Robert Zemeckis 5 | |
Wes Anderson 5 | |
Adam McKay 4 | |
Andrew Adamson 4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment