今日のネタ帳に「数学」とだけメモが残ってるんだけど
ここから何をどう広げて書こうとしてたんだろう…
今更ながら買ってみた。
歌詞の「走らないけど止まりはしない」とか「立ち向かうけどたまには逃げる」
という部分がタイヘン気に入りました :)
11/2 のジュンク堂書店池袋本店(のPC書)のtwitterアカウントからの投稿
なんか気になったので調べてみた。
コンテンツと人とログは何を生み出すのか?『インターネットを生命化する プロクロニズムの思想と実践』:[mi]みたいもん!
ということでとりあえず wishlist に放り込んでおこう。
Amazon.co.jp
ここ数日 GNU APLのソース読んでません。
glibc regex のアレ
extend_buffers (mctx, next_char_idx + 1);
の呼び出しが
ソース上では三箇所あるんだけど、この関数での呼び出しだけが
ループの中にあるのでここが一番アヤシイ気がするんだよねえ
/* Check whether the regular expression match input string INPUT or not,
and return the index where the matching end, return -1 if not match,
or return -2 in case of an error.
FL_LONGEST_MATCH means we want the POSIX longest matching.
If P_MATCH_FIRST is not NULL, and the match fails, it is set to the
next place where we may want to try matching.
Note that the matcher assume that the maching starts from the current
index of the buffer. */
static int
internal_function __attribute_warn_unused_result__
check_matching (re_match_context_t *mctx, int fl_longest_match,
int *p_match_first)
{
(略)
while (!re_string_eoi (&mctx->input))
{
re_dfastate_t *old_state = cur_state;
int next_char_idx = re_string_cur_idx (&mctx->input) + 1;
if ((BE (next_char_idx >= mctx->input.bufs_len, 0)
&& mctx->input.bufs_len < mctx->input.len)
|| (BE (next_char_idx >= mctx->input.valid_len, 0)
&& mctx->input.valid_len < mctx->input.len))
{
err = extend_buffers (mctx, next_char_idx + 1);
if (BE (err != REG_NOERROR, 0))
{
assert (err == REG_ESPACE);
return -2;
}
}
cur_state = transit_state (&err, mctx, cur_state);
if (mctx->state_log != NULL)
cur_state = merge_state_with_log (&err, mctx, cur_state);
if (cur_state == NULL)
{
/* Reached the invalid state or an error. Try to recover a valid
state using the state log, if available and if we have not
already found a valid (even if not the longest) match. */
if (BE (err != REG_NOERROR, 0))
return -2;
if (mctx->state_log == NULL
|| (match && !fl_longest_match)
|| (cur_state = find_recover_state (&err, mctx)) == NULL)
break;
}
if (BE (at_init_state, 0))
{
if (old_state == cur_state)
next_start_idx = next_char_idx;
else
at_init_state = 0;
}
if (cur_state->halt)
{
/* Reached a halt state.
Check the halt state can satisfy the current context. */
if (!cur_state->has_constraint
|| check_halt_state_context (mctx, cur_state,
re_string_cur_idx (&mctx->input)))
{
/* We found an appropriate halt state. */
match_last = re_string_cur_idx (&mctx->input);
match = 1;
/* We found a match, do not modify match_first below. */
p_match_first = NULL;
if (!fl_longest_match)
break;
}
}
}
if (p_match_first)
*p_match_first += next_start_idx;
return match_last;
}
ステップ実行して追いかけてみるかねえ…