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
Mojo::Loader->new->load => Mojo::Loader->load_class | |
Mojo::Home->rel_dir => Mojo::Home->rel_file |
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
# Configure with debugging allows using PerlIO_printf(Perl_debug_log, "", …); | |
./Configure -des -Dusedevel -Dprefix=$HOME/localperl -DDEBUGGING | |
# But -DDEBUGGING does not seem to work so I use this: | |
./Configure -des -Dusedevel -Dprefix=$HOME/localperl -A ccflags=-DDEBUGGING | |
# Just build a bare bones executable | |
make miniperl | |
# Run code |
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 feature 'say'; | |
use Algorithm::Combinatorics qw(variations_with_repetition permutations); | |
use List::SomeUtils qw/zip natatime/; | |
my $nums = [qw{75 25 5 8 10 9}]; |
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
Surprisingly this error was triggered by the solr client libraries not posting correctly and letting the connection time out. | |
Nothing to do with garbage collection (GC) or memory which all other search results suggested. | |
Hope someone finds this helpful | |
2021-03-25 23:34:17.196 ERROR (qtp1463355115-1924) [c:charter_se s:shard2 r:core_node5 x:charter_se_shard2_replica_n2] o.a.s.s.HttpSolrCall java.io.IOException: java.util.concurrent.TimeoutException: Idle timeout expired: 120000/120000 ms | |
at org.eclipse.jetty.server.HttpInput$ErrorState.noContent(HttpInput.java:1091) | |
at org.eclipse.jetty.server.HttpInput.read(HttpInput.java:321) | |
at org.apache.solr.servlet.ServletInputStreamWrapper.read(ServletInputStreamWrapper.java:74) |
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
✔ 18:00 /projects/perl-git [ blead | ✚ 14 …2 ] $ perl -wle "package foo'bar; sub lol { print 'lol'; }; foo'bar::lol()" | |
lol | |
✔ 18:00 /projects/perl-git [ blead | ✚ 14 …2 ] $ ./perl -wle "package foo'bar; sub lol { print 'lol'; }; foo'bar::lol()" | |
Bareword found where operator expected at -e line 1, near "'bar; sub lol { print 'lol" | |
(Missing operator before lol?) | |
Unquoted string "lol" may clash with future reserved word at -e line 1. | |
String found where operator expected at -e line 1, near "lol'; }; foo'" | |
Bareword found where operator expected at -e line 1, near "'; }; foo'bar::lol" | |
(Missing operator before bar::lol?) |
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 _get_deb_candidates { | |
my ( $self, $wanted_pkgs) = @_; | |
$self->log('._deb_deb_candidates')->logdie("Please provide packages to search for") unless $wanted_pkgs; | |
my $candidates; | |
for my $wanted_pkg (keys %{$wanted_pkgs}) { | |
my $pkg_pattern = $self->_get_pkg_alternatives_pattern($wanted_pkg); |
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
is(Build::Debian::Dpkg->cmp_fileversion('test_1.10_amd64.deb','1.2'), 1,'cmp_fileversion: test_1.10_amd64.deb > 1.2'); | |
is(Build::Debian::Dpkg->cmp_fileversion('cpan-libfiltered-perl_0.0.7-1355404556_all.deb','v0.0.4'), 1,'cmp_fileversion: cpan-libfiltered-perl_0.0.7-1355404556_all.deb > v0.0.4'); | |
is(Build::Debian::Dpkg->cmp_fileversion('libdatetime-timezone-perl_1.58-1+2013b_all.deb', '1.09'), 1, 'cmp_fileversion: libdatetime-timezone-perl_1.58-1+2013b_all.deb > 1.09'); | |
is(Build::Debian::Dpkg->cmp_fileversion('libtest-perl_1.10_amd64.deb','1.2'), -1, 'cmp_fileversion: libtest-perl_1.10_amd64.deb < 1.2'); | |
is(Build::Debian::Dpkg->cmp_fileversion('libc6_2.13-38_amd64.deb','2.13'), 1, 'cmp_fileversion: libc6_2.13-38_amd64.deb > 2.13'); | |
is(Build::Debian::Dpkg->cmp_fileversion('libc6_2.13_amd64.deb','2.13'), 0, 'cmp_fileversion: libc6_2.13_amd64.deb == 2.13'); | |
is(Build::Debian::Dpkg::version_compare('0.0.7','v0.0.4' ), 1, 'Comparing versio |
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
package MojoCarpAlways; | |
use Mojo::Base -strict; | |
use Mojo::Exception; | |
*Mojo::Exception::to_string = sub { | |
my $self = shift; | |
my $str = $self->message; | |
$str .= join "\n", map { " $_->[1]: " . $_->[2] } @{ $self->frames }; |
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
# Failed test 'query that remove defaults' | |
# at t/Solr.pm line 20. | |
# Comparing $data->{"allowed_supplier_ids"} as a SubBag | |
# Extra: '66' | |
# { | |
# 'adults' => 2, | |
# 'allowed_supplier_ids' => '***masked***', | |
# 'children' => 0, | |
# 'collapse_field' => 'hotel_id', | |
# 'facet_min_count' => 0, |
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
$ perl -Ilib -wle 'use Mojo::Promise; for my $die (qw/0 1/) { warn "$die\n"; my $p = Mojo::Promise->new; $p->then(sub { die if $die; })->then(sub { return "survived"; }, sub { return "died"; })->then(sub { print shift . " but recovered" }); $p->resolve; $p->wait; }' | |
0 | |
survived but recovered | |
1 | |
died but recovered | |
vs | |
$ perl -Ilib -wle 'use Mojo::Promise; for my $die (qw/0 1/) { warn "$die\n"; my $p = Mojo::Promise->new; $p->then(sub { die if $die; })->then(sub { return "survived"; }, sub { die "died"; })->then(sub { print shift . " but recovered" }, sub { print "died but not recovered" }); $p->resolve; $p->wait; }' | |
0 |
NewerOlder