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/perl | |
use strict; | |
use File::Slurp qw/slurp/; | |
use LWP::Simple qw/get/; | |
my $jpa_dir = '/home/ktat/git/github/jpa-translation/'; | |
my $assets_dir = '/home/ktat/git/github/PJP/assets/perldoc.jp/docs/modules/'; | |
copy_to_pjp_assets($jpa_dir, $assets_dir); |
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
(defun oi () | |
(interactive) | |
(insert "=begin original\n\n") | |
(search-forward-regexp "^\n") | |
(goto-char (match-beginning 0)) | |
(insert "\n=end original\n") | |
) |
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
% sudo tcpdump 'tcp port 5000' -i lo -A -ttt | |
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode | |
listening on lo, link-type EN10MB (Ethernet), capture size 96 bytes | |
00:00:00.000000 IP gatto.36312 > gatto.5000: Flags [F.], seq 468590568, ack 468536422, win 257, options [nop,nop,TS val 20656595 ecr 20655989], length 0 | |
E..43p@.@. R..................Lf.....p..... | |
.;1..;/u | |
00:00:00.000041 IP gatto.5000 > gatto.36312: Flags [.], ack 1, win 256, options [nop,nop,TS val 20656595 ecr 20656595], length 0 | |
E..4..@.@.<...............Lf............... | |
.;1..;1. | |
00:00:00.001033 IP gatto.36316 > gatto.5000: Flags [S], seq 665707558, win 32792, options [mss 16396,sackOK,TS val 20656595 ecr 0,nop,wscale 7], length 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
% sudo tcpdump 'tcp port 5000' -i lo -A -ttt | |
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode | |
listening on lo, link-type EN10MB (Ethernet), capture size 96 bytes | |
00:00:00.000000 IP gatto.36255 > gatto.5000: Flags [S], seq 2660630935, win 32792, options [mss 16396,sackOK,TS val 20641806 ecr 0,nop,wscale 7], length 0 | |
E..<..@[email protected] ........................T.....@.... | |
.:.......... | |
00:00:00.000040 IP gatto.5000 > gatto.36255: Flags [S.], seq 2660819315, ack 2660630936, win 32768, options [mss 16396,sackOK,TS val 20641806 ecr 20641806,nop,wscale 7], length 0 | |
E..<..@.@.<................s..............@.... | |
.:...:...... | |
00:00:00.000035 IP gatto.36255 > gatto.5000: Flags [.], ack 1, win 257, options [nop,nop,TS val 20641806 ecr 20641806], length 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
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use POSIX ":sys_wait_h"; | |
use Protocol::WebSocket::Handshake::Client; | |
use Protocol::WebSocket::Frame; | |
use IO::Socket; | |
use open ':utf8'; |
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/perl | |
use utf8; | |
use strict; | |
use warnings; | |
use Protocol::WebSocket::Handshake::Client; | |
use Protocol::WebSocket::Frame; | |
use IO::Socket; | |
use IO::Select; |
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/perl | |
use utf8; | |
use strict; | |
use warnings; | |
use AnyEvent; | |
use Protocol::WebSocket::Frame; | |
use Protocol::WebSocket::Handshake::Client; | |
use IO::Socket; | |
use constant {READ => 0, WRITE => 1}; |
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 Text::Xslate; | |
my $t = Text::Xslate->new(syntax => 'TTerse'); | |
print $t->render_string(<<__END__); | |
[% | |
# | |
# | |
# | |
# | |
# | |
# |
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 search { | |
my ($self, $table_name, $where, $opt) = @_; | |
my $table = $self->schema->get_table( $table_name ); | |
if (! $table) { | |
Carp::croak("No such table $table_name"); | |
} | |
my $sql_maker = $self->sql_builder; | |
my $stmt = $sql_maker->new_select(select => $opt->{columns} || $table->columns); |
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
# 問題では、add_to_items($value, \@array); でしたので、書き換わりません。 | |
# と、指摘いただきました。 | |
{ | |
my ($value, $array_ref) = (1, [1,2,3,4]); | |
add_to_items($value, $array_ref); | |
print join ",", @$array_ref; | |
# 2,3,4,5 | |
} |
OlderNewer