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
| $('#container1').droppable({ | |
| accept : '.element', | |
| drop : on_drop | |
| }); | |
| $('#container1').children().each( function () { | |
| $(this).draggable({ | |
| snap : true, | |
| revert : true | |
| }); | |
| }); |
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 url2text{ | |
| my $url = shift; | |
| my $ua = LWP::UserAgent->new; | |
| my $res = $ua->get( $url ); | |
| if( $res->is_error ){ | |
| print 'some error: ', $res->status_line; | |
| } | |
| my $html = $res->decoded_content; |
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 morphological_analysis_by_mecab { | |
| my $decoded_str = shift; | |
| my @array_terms; | |
| my $mecab = Text::MeCab->new({ | |
| userdic => 'hoge.dic', | |
| } | |
| ); | |
| my $str = encode('euc-jp', $decoded_str); | |
| my $node = $mecab->parse($str); |
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/perl | |
| use strict; | |
| use warnings; | |
| use JSON; | |
| use CGI; | |
| use DBI; | |
| use Encode qw/ decode_utf8 /; | |
| my $cgi = CGI->new; | |
| my $table = $cgi->url_param('table'); |
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
| function get_properies ( obj ) { | |
| var property, array_of_property | |
| ; | |
| array_of_property = []; | |
| for ( property in obj ) { | |
| if ( obj.hasOwnProperty( property ) ) { | |
| array_of_property.push( property ); | |
| } | |
| } |
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
| function uri_parameter_string_to_object ( uri_param_string_with_question_mark ) { | |
| // delete '?' | |
| var uri_param_string_without_question_mark | |
| = uri_param_string_with_question_mark.replace('?', ''); | |
| // split by '&' | |
| var uri_param_name_equal_value_array | |
| = uri_param_string_without_question_mark.split('&'); | |
| // create uri_param object{ param_name : value } |
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; | |
| our $foo = 'This is foo schalar'; | |
| our @foo = ('This', 'is', 'foo', 'array'); | |
| our %foo = ('This is foo' => 'hash'); | |
| our ( $bar, @bar, %bar ); | |
| *bar = *foo; |
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
| function uri_parameter_string_to_object ( uri_param_string_with_question_mark ) { | |
| var uri_param_string_without_question_mark | |
| , uri_param_name_equal_value_array | |
| , uri_param_container | |
| , param_name_equal_value_string | |
| , param_name_and_value_set | |
| , uri_param_name | |
| , uri_param_value | |
| , length | |
| , i = 0 |
NewerOlder