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
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use autodie ':io'; | |
use utf8; | |
use open ':std', ':encoding(UTF-8)'; | |
use File::Temp; | |
use File::Copy qw(move); | |
my $JP_SPACE = ' '; |
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
/// Widget which pops all open pages except for the root (SearchPage) and | |
/// sets the query parameters. | |
class OpenSearchPage extends ConsumerWidget { | |
final Query query; | |
const OpenSearchPage({ | |
Key? key, | |
required this.query, | |
}) : super(key: key); |
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
1 強風で、家から( )出られなかった。 | |
1)出ようにも 2)出ようが 3)出たなら 4)出れば | |
2 身長2メートル( )大男が、突然、目の前に現れた。 | |
1)だけある 2)からする 3)だけする 4)からある | |
3 花田さんの冗談には、いつも思わず( )。 | |
1)笑われた 2)笑わせた 3)笑わせられた 4)笑わさせられた | |
4 だれにも知られること( )準備を進めなければならない。 | |
1)なくて 2)なしに 3)ないで 4)ないと | |
5 患者のプライバシーを他の人に漏らすなんて、医者としてある( )ことだ。 | |
1)べからず 2)はずの 3)かぎりの 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
import argparse, collections, re | |
parser = argparse.ArgumentParser(description='Test yourself on the JLPT N1 question set') | |
parser.add_argument( | |
'--start', type=int, help='Question number to start from', default=1) | |
parser.add_argument( | |
'--question-file', type=str, help='Path to question file', default='JLPT1 Questions.txt') | |
args = parser.parse_args() | |
def run_quiz(start, question_file): |
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
# JLPT N1 question parser. Type 'q' or Ctrl+C to quit. | |
#!/usr/bin/env perl | |
use utf8; | |
use strict; | |
use warnings; | |
use Getopt::Long; | |
use Scalar::Util qw(looks_like_number); | |
my $question_file = 'JLPT1 Questions.txt'; | |
my $start = 1; | |
GetOptions( |
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
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use autodie ':io'; | |
use Time::Duration qw(duration); | |
use Date::Parse qw(str2time); | |
my $min_gap = shift || 3600; | |
my $prev; |
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
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use autodie ':io'; | |
use DateTime::Format::Human::Duration; | |
use DateTime::Format::Strptime; | |
my $min_gap = shift || 3600; | |
my $span = DateTime::Format::Human::Duration->new; | |
my $dtparse = DateTime::Format::Strptime->new( |
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
use strict; | |
use warnings; | |
use AnyEvent; | |
use AnyEvent::DNS; | |
my %results; | |
my $cv = AnyEvent->condvar; | |
open my $fh, '<', 'input.txt' or die "read: $!"; | |
while (my $host = <$fh>) { | |
chomp $host; |