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
| =comment | |
| 実行結果: | |
| gotou-no-MacBook-Air:perl kiyotakagoto$ ll packed_ints; ll vbcoded; ll gapped_vbcoded; ll packed_ints_random; ll vbcoded_random; ll gapped_vbcoded_random; | |
| -rw-r--r-- 1 kiyotakagoto staff 40004 2 5 23:37 packed_ints | |
| -rw-r--r-- 1 kiyotakagoto staff 20002 2 5 23:37 vbcoded | |
| -rw-r--r-- 1 kiyotakagoto staff 10002 2 5 23:37 gapped_vbcoded | |
| -rw-r--r-- 1 kiyotakagoto staff 40000 2 5 23:37 packed_ints_random | |
| -rw-r--r-- 1 kiyotakagoto staff 39589 2 5 23:37 vbcoded_random | |
| -rw-r--r-- 1 kiyotakagoto staff 20151 2 5 23:37 gapped_vbcoded_random | |
| gotou-no-MacBook-Air:perl kiyotakagoto$ |
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
| javascript:( | |
| function () { | |
| var stack = []; | |
| var wiki_content_div = ( document.getElementsByClassName('wiki-content') )[0]; | |
| var header_number = [1,2,3,4,5,6,7,8,9,10]; | |
| var header_number_num = header_number.length; | |
| var i, j; | |
| var headers; | |
| var headers_num; | |
| var wiki_contents = wiki_content_div.childNodes; |
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
| # 参考:http://www.brucelindbloom.com/index.html?Eqn_DeltaE_CIE2000.html | |
| =comment | |
| $labx = { | |
| L => value, | |
| a => value, | |
| b => value, | |
| }; | |
| =cut |
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
| # 参考:http://www005.upp.so-net.ne.jp/fumoto/linkp25.htm | |
| sub xyz_to_Lab { | |
| my $xyz_href = shift; | |
| my ($Xn, $Yn, $Zn) = ( 98.072, 100, 118.225); | |
| #my ($Xn, $Yn, $Zn) = ( 95.045, 100, 108.892); | |
| my $Lab = { | |
| L => 116 * ( ($xyz_href->{X} / $Yn) ** (1/3) ) - 16, | |
| a => 500 * ( ($xyz_href->{X} / $Xn) ** (1/3) - ($xyz_href->{Y} / $Yn) ** (1/3) ), | |
| b => 200 * ( ($xyz_href->{Y} / $Yn) ** (1/3) - ($xyz_href->{Z} / $Zn) ** (1/3) ), |
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
| use strict; | |
| my( @row ); | |
| while(<STDIN>){ | |
| chomp; | |
| s/\s*\\\\\s*//g; | |
| s/\\hline//g; | |
| push @row, [split /\s*&\s*/]; | |
| } | |
| for( my $i = 0; $i <= $#{@{$row[0]}}; $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
| # 参考:http://www005.upp.so-net.ne.jp/fumoto/linkp25.htm | |
| package sRGBtoXYZ; | |
| use strict; | |
| use warnings; | |
| sub srgb_to_xyz { | |
| my $rgb_href = shift; | |
| my $rgb_dash_href = { |
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
| package RGBtoHSV; | |
| use strict; | |
| use warnings; | |
| sub rgb_to_hsv { | |
| my $rgb_ref = shift; | |
| my $max_c = get_max( $rgb_ref ); | |
| my $min_c = get_min( $rgb_ref ); |
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
| my $sql = 'select * from hoge where'; | |
| my (@where, @bind); | |
| push @where, 'name = ?'; | |
| push @bind, 'aiueo'; | |
| push @where, 'name = ?'; | |
| push @bind, 'kakikukeko'; |
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
| use Time::HiRes; | |
| my $num = 0; | |
| ##### gettimeofday() は、1つ目の要素が整数秒、2つ目の要素が小数点以下の数値である配列を返す | |
| my $start_time = join '.', Time::HiRes::gettimeofday; | |
| while ( $num < 10000000 ) { | |
| print $num++, "\n"; | |
| } | |
| my $end_time = join '.', Time::HiRes::gettimeofday; |
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
| $('#keywords').droppable({ | |
| accept : '.key', | |
| drop : on_drop | |
| }); | |
| $('#keywords').children().each( function () { | |
| $(this).draggable({ | |
| snap : true, | |
| revert : true | |
| }); | |
| }); |
NewerOlder