#!/usr/bin/perl -w
use strict;
use HTML::Scrubber;
use feature 'say';
my @default = (
1 => {
'*' => 1,
itemprop => 0,
itemscope => 0,
itemtype => 0,
}
);
my $scrubber = HTML::Scrubber->new(
default => \@default,
process => 0,
);
my $html = join( '', <DATA> );
say $scrubber->scrub($html);
__DATA__
<div itemscope itemtype ="http://schema.org/Movie">
<h1 itemprop="name">Avatar</h1>
<span>Director: <span itemprop="director">James Cameron</span> (born August 16, 1954)</span>
<span itemprop="genre">Science fiction</span>
<a href="../movies/avatar-theatrical-trailer.html" itemprop="trailer">Trailer</a>
</div>
<div>
<h1>Avatar</h1>
<span>Director: <span>James Cameron</span> (born August 16, 1954)</span>
<span>Science fiction</span>
<a href="../movies/avatar-theatrical-trailer.html">Trailer</a>
</div>
#!usr/bin/perl-w
use strict;
use Term::ReadKey;
use feature 'say';
ReadMode 4;
say "Нажмите любую клавишу для паузы";
say "Нажмите ESC для выхода";
my $key;
$| = 1;
my $x = 1;
sub check_esc {
my $key = shift;
if ( ord($key) == 27 ) { ReadMode 0; exit 0; }
else { return 1; }
}
while ( $x < 99999 ) {
sleep 3;
$x++;
say $x;
if ( defined( $key = ReadKey(-1) ) ) {
&check_esc($key);
say "Ура, Пауза! Нажмите любую клавишу для продолжения ...";
while ( not defined( $key = ReadKey(-1) ) ) { }
&check_esc($key);
}
}
ReadMode 0;
Нажмите любую клавишу для паузы
Нажмите ESC для выхода
2
3
4
5
Ура, Пауза! Нажмите любую клавишу для продолжения ...
6
7
8
gunicorn posuda_shop.wsgi:application -bind localhost:8001
Client-side processing - DOM sourced data: ~5'000 rows.
Client-side processing - Ajax sourced data (ajax): ~50'000 rows.
Server-side processing (serverSide): millions of rows.
ResSeats.query.filter_by(res_id=sessio.film_id).order_by(res_id.desc()).limit(1)
@app.route('/foo')
def foo():
raw = str(request)
return raw
curl 'localhost:5000/foo?r=M&Ms'
<Request 'http://localhost:5000/foo?r=M&Ms' [GET]>
@app.route('/foo')
def foo():
raw = str(request)
print(raw)
p = re.compile(r"""(\?|\&)([^=]+)\=(?P<val>([^']+))""")
r = p.search(raw)
return r.group("val")
use strict;
use warnings;
use utf8;
my $csv = <<'EOF';
ClassA1,mark,chemistry,5
ClassA2,mark,philosofyr,5
ClassA2,julia,physic,5
ClassA1,julia,math,3
ClassA1,mark,philosophy,5
ClassA1,julia,chemistry,4
ClassA2,mark,chemistry,4
ClassA2,julia,literature,2
EOF
my @csv = split "\n", $csv;
my (%sum, %count);
for my $row (@csv) {
my ( $class, $name, undef, $num ) = split ",", $row;
my $key = $class . '-' . $name;
$sum{$key} += $num;
$count{$key} += 1;
}
for my $name_class ( keys %sum ) {
print $name_class, $sum{$name_class}/$count{$name_class}, "\n";
}
ClassA1-julia3.5
ClassA2-julia3.5
ClassA2-mark4.5
ClassA1-mark5