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/env perl | |
use strict; | |
use warnings; | |
use utf8; | |
use DBI; | |
use Teng; | |
use Teng::Schema::Loader; | |
use Data::Dumper; |
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
#include <stdio.h> | |
#define N 100 | |
int sp = 0; | |
int a[N]; | |
void push(int b){ | |
if (sp < N) | |
a[sp++] = b; | |
else |
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 env | |
use strict; | |
use warnings; | |
use 5.010; | |
use Math::Round; | |
my $k = 32; | |
my %winner = ( | |
'name' => 'John', |
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; | |
# How to use? | |
# perl auto.pl | |
# or | |
# perl auto.pl hostname | |
# or |
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 Net::Twitter; | |
use URI::Escape; | |
my ($id, $latest_id); | |
my $twi = Net::Twitter->new({ | |
traits => ['API::RESTv1_1'], |
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/env perl | |
use utf8; | |
use Mojolicious::Lite; | |
use DateTime; | |
use Mojo::JSON qw/decode_json encode_json/; | |
use Encode qw/from_to decode_utf8 encode_utf8/; | |
use Data::Dumper qw/Dumper/; | |
get '/' => sub { | |
my $self = shift; |
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 utf8; | |
my $phrase = "My name is 404 "; | |
my @text = split("", $phrase); | |
my $array_num = @text; |
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; | |
my $b = 10; | |
eval "\$b += 100;"; | |
eval "print \"Hello, eval\n\";"; | |
print "$b\n"; |
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
void ssleep(int msec) { | |
struct timespec tm; | |
tm.tv_sec = 0; | |
tm.tv_nsec = msec * 1000L * 1000L; | |
nanosleep(&tm, NULL); | |
} | |
/* | |
how to use !! |
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 YAML::XS; | |
use YAML::Syck; | |
use Data::Dumper; | |
my $filename = "osusume.yaml"; | |
open(IN, $filename) or die("cannnot open file."); |