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 5.010; | |
my $n = "\n"; | |
my %hash = ("foo", 35, "bar", 12.4, 2.5, "hello"); | |
say $_ foreach (%hash); | |
print $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
use strict; | |
use YAML::XS; | |
my %h = ("12" => 4); | |
$h{foo} = "bar"; | |
my @array = qw/apple banana orange/; | |
## YAMLドキュメントの読み込み | |
my $filename = YAML::XS::Load("example.yaml"); | |
open F, '>>', $filename or die("cannot open 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
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use 5.010; | |
use utf8; | |
use Encode qw/encode_utf8 decode_utf8/; | |
use CaboCha; | |
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
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
my $num = 0; | |
map{$num += $_} map{$num += $_} 1..2; | |
print $num; |
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/python | |
# coding: UTF-8 | |
import random | |
a = range(10) | |
for i in range(10): | |
a[i] = random.randint(0,10) | |
print "a" |
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; | |
sub into(\@$$); | |
sub onto(\@$$); | |
sub into(\@$$){ | |
my $i = 0; | |
my @new_array; # 新しい配列 | |
my @before_array = @{$_[0]}; # 参照渡しされた配列を代入 |
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 Mojolicious::Lite; | |
# Documentation browser under "/perldoc" | |
plugin 'PODRenderer'; | |
get '/' => sub { | |
my $c = shift; | |
$c->stash->{message} = "Hello Mojo!"; | |
$c->stash->{test} = "Test Mojo..."; |
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
#define _____________ main | |
#define ____________ int | |
#define ___________ char | |
#define __________ while | |
#define _________ printf | |
#define ________ "%s\n" | |
#define _______ 115 | |
#define ______ _==108?__[4]=___:_==111?__[5]=___:_==114?__[6]=___ | |
_____________(){ ____________ _;___________ __[7];___________ *___; |
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> | |
int main(){ | |
for (int i = 1; i <= 7; ++i) | |
{ | |
printf("*"); | |
if (i % 3 == 1) | |
for (int i = 0; i < 4; ++i) printf("*"); | |
printf("\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
#include <stdio.h> | |
int main(){ | |
float vertically, horizontally; | |
float inch = 2.54; | |
float ans; | |
printf("まずは横の入力\n"); | |
scanf("%f",&vertically); |