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
(defvar accelerated-move:buffer nil) | |
(defvar accelerated-move:count 0) | |
(defvar accelerated-move:point (make-hash-table)) | |
(defvar accelerated-move:table '(7 12 17 21 24 26 28 30)) | |
(defun accelerated-move:previous (&optional arg try-vscroll) | |
(interactive "^p\np") | |
(accelerated-move:do 'previous-line "previous" arg try-vscroll)) | |
(defun accelerated-move:next (&optional arg try-vscroll) |
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
(defun fetch-and-save (url filename) | |
(let (buffer) | |
(setq buffer (url-retrieve-synchronously url)) | |
(switch-to-buffer buffer) | |
(goto-char (point-min))(search-forward "\n\n")(kill-region (point-min) (point)) ;; delete http headers | |
(write-file filename) | |
(kill-buffer buffer) | |
)) |
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; | |
use warnings; | |
use utf8; | |
use Test::More; | |
use Test::Builder; | |
BEGIN { | |
use_ok('AvoidCoreTextBug'); |
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 AvoidCoreTextBug; | |
use strict; | |
use warnings; | |
our %SEPARATORS = map { $_ => 1 } (0x20, 0xa0, | |
0x1680, 0x180e, | |
0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200a, | |
0x202f, 0x205f, | |
0x3000, |
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 Expect; | |
my $MYSQL_COMMAND = '/usr/bin/mysql'; | |
my $expect = new Expect; |
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 _magic_token { | |
my($self, $fullpath) = @_; | |
$self->{serial_opt} ||= Data::MessagePack->pack([ | |
ref($self->{compiler}) || $self->{compiler}, | |
$self->_filter_options_for_magic_token($self->_extract_options($self->parser_option)), | |
$self->_filter_options_for_magic_token($self->_extract_options($self->compiler_option)), | |
$self->input_layer, | |
[sort keys %{ $self->{function} }], | |
]); |
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 B; | |
use Apache2::RequestUtil; | |
print <<"END;"; | |
Content-type: text/plain |
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
よく似た症状を再現させる方法 | |
・memcachedを起動 | |
・gdb -p <PID> で attach | |
(gdb) call pthread_mutex_lock(&conn_lock) | |
(gdb) call pthread_mutex_lock(&conn_lock) | |
2回目はlockするので Ctrl-C で中断 | |
(gdb) detach | |
これで同じ症状になります。 |
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 _generate_call { | |
my($self, $node) = @_; | |
my $callable = $node->first; # function or macro | |
my $args = $node->second; | |
my @code = $self->SUPER::_generate_call($node); | |
if($callable->arity eq 'name'){ | |
my @code_fetch_symbol = $self->compile_ast($callable); | |
@code = ( |
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 _generate_variable { | |
my($self, $node) = @_; | |
if(defined(my $lvar_id = $self->lvar->{$node->value})) { | |
return $self->opcode( load_lvar => $lvar_id, symbol => $node ); | |
} | |
else { | |
my $name = $self->_variable_to_value($node); | |
my @code; |