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
_,,....,,_ _人人人人人人人人人人人人人人人_ | |
-''":::::::::::::`''> ゆっくりしていってね!!! < | |
ヽ::::::::::::::::::::: ̄^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^ ̄ | |
|::::::;ノ´ ̄\:::::::::::\_,. -‐ァ __ _____ ______ | |
|::::ノ ヽ、ヽr-r'"´ (.__ ,´ _,, '-´ ̄ ̄`-ゝ 、_ イ、 | |
_,.!イ_ _,.ヘーァ'二ハ二ヽ、へ,_7 'r ´ ヽ、ン、 | |
::::::rー''7コ-‐'"´ ; ', `ヽ/`7 ,'==─- -─==', i | |
r-'ァ'"´/ /! ハ ハ ! iヾ_ノ i イ iゝ、イ人レ/_ルヽイ i | | |
!イ´ ,' | /__,.!/ V 、!__ハ ,' ,ゝ レリイi (ヒ_] ヒ_ン ).| .|、i .|| | |
`! !/レi' (ヒ_] ヒ_ン レ'i ノ !Y!"" ,___, "" 「 !ノ i | |
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
require 'benchmark' | |
puts Benchmark.measure { | |
(2..100).select { |n| '_' * n !~ /\A(__+)\1+\z/ } | |
} | |
puts ">_<X" | |
puts ">_<X" | |
puts ">_<X" | |
puts ">_<X" |
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
class Problem | |
attr_reader :x, :y, :op | |
def initialize(op, x, y) | |
@op = op | |
@x = x | |
@y = y | |
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
puts "hello" |
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
open my $ruby, '|/opt/local/bin/ruby'; | |
print $ruby 'puts "hello"'; | |
close $ruby; |
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
tell application "iTunes" | |
play | |
repeat while (true) | |
delay 1 | |
next track | |
end repeat | |
end tell |
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/env perl | |
use strict; | |
use warnings; | |
use Perl6::Say; | |
use Data::Dumper; | |
use Test::More qw(no_plan); | |
sub p ($) { | |
say Dumper @_; | |
} |
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/env perl | |
use strict; | |
use warnings; | |
sub bucket_sort { | |
my ($array, $range) = @_; | |
my @bucket; | |
push @{ $bucket[$_] ||= [] }, $_ for @$array; | |
return [ map {@{$bucket[$_]}} grep {$bucket[$_]} (0..$range) ]; | |
} |
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/env perl | |
use strict; | |
use warnings; | |
use Perl6::Say; | |
use Data::Dumper; | |
#use Test::More qw(no_plan); | |
sub p ($) { | |
say Dumper @_; | |
} |
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 bubble_sort { | |
my ($array) = @_; | |
for my $i (0..$#$array) { | |
for my $j (0..($#$array-$i-1)) { | |
if ($array->[$j] > $array->[$j+1]) { | |
($array->[$j], $array->[$j+1]) = ($array->[$j+1], $array->[$j]); | |
} | |
} | |
} | |
return $array; |
OlderNewer