This file contains hidden or 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
| #!/usr/bin/env perl | |
| # in response to http://stackoverflow.com/a/10841473/468327 | |
| use strict; | |
| use warnings; | |
| my %data; | |
| my $tag = 'Initial'; | |
| while (<DATA>) { | |
| chomp; |
This file contains hidden or 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
| #!/usr/bin/env perl | |
| use strict; | |
| use warnings; | |
| use PerlGSL ':all'; | |
| # General concept: | |
| # For a given d solve for c | |
| # _ |
This file contains hidden or 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
| #!/usr/bin/env perl | |
| use strict; | |
| use warnings; | |
| seek DATA, 0, 0; | |
| print while <DATA>; | |
| __DATA__ |
This file contains hidden or 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
| sub _data_printer { | |
| my ($self, $props) = @_; | |
| ################################################ | |
| # Get Data, Build Structure # | |
| # add new things as [ tag => data ] to @data # | |
| ################################################ | |
| my @data; | |
| # type |
This file contains hidden or 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
| #!/usr/bin/env perl | |
| use strict; | |
| use warnings; | |
| use PDL; | |
| use PDL::ImageND; | |
| use PDL::Graphics::Prima::Simple; | |
| my $x = sequence(50); |
This file contains hidden or 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
| use 5.14.0; | |
| no strict; #! | |
| use Text::ParseWords; | |
| print "$_ => $c{$_}\n" for | |
| sort { $c{$b} <=> $c{$a} } | |
| grep { ! $c{$_}++ } | |
| map { (split '/', $_->[$_->[0] =~ /=/])[-1] } | |
| map { [ shellwords( s/^\s*\d+\s*//r ) ] } | |
| <>; |
This file contains hidden or 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
| #!/usr/bin/env perl | |
| use strict; | |
| use warnings; | |
| use PDL; | |
| use PDL::Image2D; | |
| use PDL::Fit::Gaussian; | |
| use Prima; |
This file contains hidden or 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
| use strict; | |
| use warnings; | |
| use PDL; | |
| use PDL::Stats; | |
| my $x = pdl [ 1, 2, 3, 4 ]; | |
| my $y = pdl [ 1.3, 2.9, 4.2, 5.4 ]; | |
| # get just the coeffs: |
This file contains hidden or 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
| #!/usr/bin/env perl | |
| use strict; | |
| use warnings; | |
| use DateTime; | |
| use DateTime::Format::Flexible; | |
| my $t = DateTime->now; | |
| use Mojo::UserAgent; |
This file contains hidden or 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 ($stdout, $stderr, $result) = capture { eval $string }; | |
| my %return = ( | |
| stdout => $stdout, | |
| stderr => $stderr, | |
| ); | |
| if (ref $results eq 'HASH') { | |
| $return{$_} => $results{$_} for keys %$results; | |
| } | |
| send(encode_json(\%return)); |