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
Games-TicTacToe からモンテカルロ法のアルゴリズムだけ分離する |
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 Data::Dumper; | |
use List::Util qw/shuffle/; | |
my $roop = 1000; | |
my $number = 100; | |
my $limit = 50; |
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; | |
sub dirtify { | |
my $text = shift; | |
$text =~ s/(\S) +=(>?) +/$1 =$2 /mg; | |
$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
Contexts | |
Physical Requirements | |
- Physical Location | |
(Office, Home) | |
- Physical Object | |
(Phone, Mac, Tool) | |
- Physical Activity | |
(Email, Video Editing, Web Design) | |
- Physical State | |
(Online, Offline) |
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
// bad | |
var add_the_handlers = function (nodes) { | |
var i; | |
for (i = 0; i < nodes.length; i += 1) { | |
nodes[i].onclick = function () { | |
alert(i); | |
} | |
} | |
}; |
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 Image::Imlib2; | |
use Data::Dumper; | |
my ( $width, $height ) = ( 150, 320 ); | |
my $image_dir = 'images/avater'; | |
my @image_files = glob("$image_dir/*"); |
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
// in ZendFramework | |
// forward | |
$this->_forward( 'index', 'index', 'product' ); | |
// Exactly the same | |
$request = $this->getRequest(); | |
$request->setModuleName('product') | |
->setControllerName('index') | |
->setActionName('index') |
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
$(document).ready(function(){ | |
var d = new MyApp(); | |
d.init(); | |
}); | |
if( typeof( window.MyApp ) == "undefined") { | |
// MyApp コンストラクタ | |
var MyApp = function() { return this; }; |
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
var MYAPP = {}; | |
MYAPP.util = { | |
getData: function ( arg ) { | |
var query_string = window.document.location.href.split('?')[1]; | |
var datas = query_string.split('&'); | |
var tmp, result, i; | |
for(i=0; i<datas.length; i++) { | |
tmp = datas[i].split('='); | |
result[tmp[0]] = tmp[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/perl | |
use strict; | |
use warnings; | |
my $example = [1, '', 3, 4, '', '']; | |
sub func { | |
my ($example, $value) = @_; | |
my $ret; |
OlderNewer