亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? diff.pm

?? funambol windows mobile plugin source code, the source code is taken from the funambol site
?? PM
?? 第 1 頁 / 共 4 頁
字號:
            DISCARD_A => \&callback2,
            DISCARD_B => \&callback3,
            CHANGE    => \&callback4,
        },
        \&key_generator,
        @extra_args,
    );


=head1 INTRODUCTION

(by Mark-Jason Dominus)

I once read an article written by the authors of C<diff>; they said
that they worked very hard on the algorithm until they found the
right one.

I think what they ended up using (and I hope someone will correct me,
because I am not very confident about this) was the `longest common
subsequence' method.  In the LCS problem, you have two sequences of
items:

    a b c d f g h j q z

    a b c d e f g i j k r x y z

and you want to find the longest sequence of items that is present in
both original sequences in the same order.  That is, you want to find
a new sequence I<S> which can be obtained from the first sequence by
deleting some items, and from the secend sequence by deleting other
items.  You also want I<S> to be as long as possible.  In this case I<S>
is

    a b c d f g j z

From there it's only a small step to get diff-like output:

    e   h i   k   q r x y
    +   - +   +   - + + +

This module solves the LCS problem.  It also includes a canned function
to generate C<diff>-like output.

It might seem from the example above that the LCS of two sequences is
always pretty obvious, but that's not always the case, especially when
the two sequences have many repeated elements.  For example, consider

    a x b y c z p d q
    a b c a x b y c z

A naive approach might start by matching up the C<a> and C<b> that
appear at the beginning of each sequence, like this:

    a x b y c         z p d q
    a   b   c a b y c z

This finds the common subsequence C<a b c z>.  But actually, the LCS
is C<a x b y c z>:

          a x b y c z p d q
    a b c a x b y c z

or

    a       x b y c z p d q
    a b c a x b y c z

=head1 USAGE

(See also the README file and several example
scripts include with this module.)

This module now provides an object-oriented interface that uses less
memory and is easier to use than most of the previous procedural
interfaces.  It also still provides several exportable functions.  We'll
deal with these in ascending order of difficulty:  C<LCS>,
C<LCS_length>, C<LCSidx>, OO interface, C<prepare>, C<diff>, C<sdiff>,
C<traverse_sequences>, and C<traverse_balanced>.

=head2 C<LCS>

Given references to two lists of items, LCS returns an array containing
their longest common subsequence.  In scalar context, it returns a
reference to such a list.

    @lcs    = LCS( \@seq1, \@seq2 );
    $lcsref = LCS( \@seq1, \@seq2 );

C<LCS> may be passed an optional third parameter; this is a CODE
reference to a key generation function.  See L</KEY GENERATION
FUNCTIONS>.

    @lcs    = LCS( \@seq1, \@seq2, \&keyGen, @args );
    $lcsref = LCS( \@seq1, \@seq2, \&keyGen, @args );

Additional parameters, if any, will be passed to the key generation
routine.

=head2 C<LCS_length>

This is just like C<LCS> except it only returns the length of the
longest common subsequence.  This provides a performance gain of about
9% compared to C<LCS>.

=head2 C<LCSidx>

Like C<LCS> except it returns references to two arrays.  The first array
contains the indices into @seq1 where the LCS items are located.  The
second array contains the indices into @seq2 where the LCS items are located.

Therefore, the following three lists will contain the same values:

    my( $idx1, $idx2 ) = LCSidx( \@seq1, \@seq2 );
    my @list1 = @seq1[ @$idx1 ];
    my @list2 = @seq2[ @$idx2 ];
    my @list3 = LCS( \@seq1, \@seq2 );

=head2 C<new>

    $diff = Algorithm::Diffs->new( \@seq1, \@seq2 );
    $diff = Algorithm::Diffs->new( \@seq1, \@seq2, \%opts );

C<new> computes the smallest set of additions and deletions necessary
to turn the first sequence into the second and compactly records them
in the object.

You use the object to iterate over I<hunks>, where each hunk represents
a contiguous section of items which should be added, deleted, replaced,
or left unchanged.

=over 4

The following summary of all of the methods looks a lot like Perl code
but some of the symbols have different meanings:

    [ ]     Encloses optional arguments
    :       Is followed by the default value for an optional argument
    |       Separates alternate return results

Method summary:

    $obj        = Algorithm::Diff->new( \@seq1, \@seq2, [ \%opts ] );
    $pos        = $obj->Next(  [ $count : 1 ] );
    $revPos     = $obj->Prev(  [ $count : 1 ] );
    $obj        = $obj->Reset( [ $pos : 0 ] );
    $copy       = $obj->Copy(  [ $pos, [ $newBase ] ] );
    $oldBase    = $obj->Base(  [ $newBase ] );

Note that all of the following methods C<die> if used on an object that
is "reset" (not currently pointing at any hunk).

    $bits       = $obj->Diff(  );
    @items|$cnt = $obj->Same(  );
    @items|$cnt = $obj->Items( $seqNum );
    @idxs |$cnt = $obj->Range( $seqNum, [ $base ] );
    $minIdx     = $obj->Min(   $seqNum, [ $base ] );
    $maxIdx     = $obj->Max(   $seqNum, [ $base ] );
    @values     = $obj->Get(   @names );

Passing in C<undef> for an optional argument is always treated the same
as if no argument were passed in.

=item C<Next>

    $pos = $diff->Next();    # Move forward 1 hunk
    $pos = $diff->Next( 2 ); # Move forward 2 hunks
    $pos = $diff->Next(-5);  # Move backward 5 hunks

C<Next> moves the object to point at the next hunk.  The object starts
out "reset", which means it isn't pointing at any hunk.  If the object
is reset, then C<Next()> moves to the first hunk.

C<Next> returns a true value iff the move didn't go past the last hunk.
So C<Next(0)> will return true iff the object is not reset.

Actually, C<Next> returns the object's new position, which is a number
between 1 and the number of hunks (inclusive), or returns a false value.

=item C<Prev>

C<Prev($N)> is almost identical to C<Next(-$N)>; it moves to the $Nth
previous hunk.  On a 'reset' object, C<Prev()> [and C<Next(-1)>] move
to the last hunk.

The position returned by C<Prev> is relative to the I<end> of the
hunks; -1 for the last hunk, -2 for the second-to-last, etc.

=item C<Reset>

    $diff->Reset();     # Reset the object's position
    $diff->Reset($pos); # Move to the specified hunk
    $diff->Reset(1);    # Move to the first hunk
    $diff->Reset(-1);   # Move to the last hunk

C<Reset> returns the object, so, for example, you could use
C<< $diff->Reset()->Next(-1) >> to get the number of hunks.

=item C<Copy>

    $copy = $diff->Copy( $newPos, $newBase );

C<Copy> returns a copy of the object.  The copy and the orignal object
share most of their data, so making copies takes very little memory.
The copy maintains its own position (separate from the original), which
is the main purpose of copies.  It also maintains its own base.

By default, the copy's position starts out the same as the original
object's position.  But C<Copy> takes an optional first argument to set the
new position, so the following three snippets are equivalent:

    $copy = $diff->Copy($pos);

    $copy = $diff->Copy();
    $copy->Reset($pos);

    $copy = $diff->Copy()->Reset($pos);

C<Copy> takes an optional second argument to set the base for
the copy.  If you wish to change the base of the copy but leave
the position the same as in the original, here are two
equivalent ways:

    $copy = $diff->Copy();
    $copy->Base( 0 );

    $copy = $diff->Copy(undef,0);

Here are two equivalent way to get a "reset" copy:

    $copy = $diff->Copy(0);

    $copy = $diff->Copy()->Reset();

=item C<Diff>

    $bits = $obj->Diff();

C<Diff> returns a true value iff the current hunk contains items that are
different between the two sequences.  It actually returns one of the
follow 4 values:

=over 4

=item 3

C<3==(1|2)>.  This hunk contains items from @seq1 and the items
from @seq2 that should replace them.  Both sequence 1 and 2
contain changed items so both the 1 and 2 bits are set.

=item 2

This hunk only contains items from @seq2 that should be inserted (not
items from @seq1).  Only sequence 2 contains changed items so only the 2
bit is set.

=item 1

This hunk only contains items from @seq1 that should be deleted (not
items from @seq2).  Only sequence 1 contains changed items so only the 1
bit is set.

=item 0

This means that the items in this hunk are the same in both sequences.
Neither sequence 1 nor 2 contain changed items so neither the 1 nor the
2 bits are set.

=back

=item C<Same>

C<Same> returns a true value iff the current hunk contains items that
are the same in both sequences.  It actually returns the list of items
if they are the same or an emty list if they aren't.  In a scalar
context, it returns the size of the list.

=item C<Items>

    $count = $diff->Items(2);
    @items = $diff->Items($seqNum);

C<Items> returns the (number of) items from the specified sequence that
are part of the current hunk.

If the current hunk contains only insertions, then
C<< $diff->Items(1) >> will return an empty list (0 in a scalar conext).
If the current hunk contains only deletions, then C<< $diff->Items(2) >>
will return an empty list (0 in a scalar conext).

If the hunk contains replacements, then both C<< $diff->Items(1) >> and
C<< $diff->Items(2) >> will return different, non-empty lists.

Otherwise, the hunk contains identical items and all of the following
will return the same lists:

    @items = $diff->Items(1);
    @items = $diff->Items(2);
    @items = $diff->Same();

=item C<Range>

    $count = $diff->Range( $seqNum );
    @indices = $diff->Range( $seqNum );
    @indices = $diff->Range( $seqNum, $base );

C<Range> is like C<Items> except that it returns a list of I<indices> to
the items rather than the items themselves.  By default, the index of
the first item (in each sequence) is 0 but this can be changed by
calling the C<Base> method.  So, by default, the following two snippets
return the same lists:

    @list = $diff->Items(2);
    @list = @seq2[ $diff->Range(2) ];

You can also specify the base to use as the second argument.  So the
following two snippets I<always> return the same lists:

    @list = $diff->Items(1);
    @list = @seq1[ $diff->Range(1,0) ];

=item C<Base>

    $curBase = $diff->Base();
    $oldBase = $diff->Base($newBase);

C<Base> sets and/or returns the current base (usually 0 or 1) that is
used when you request range information.  The base defaults to 0 so
that range information is returned as array indices.  You can set the
base to 1 if you want to report traditional line numbers instead.

=item C<Min>

    $min1 = $diff->Min(1);
    $min = $diff->Min( $seqNum, $base );

C<Min> returns the first value that C<Range> would return (given the
same arguments) or returns C<undef> if C<Range> would return an empty
list.

=item C<Max>

C<Max> returns the last value that C<Range> would return or C<undef>.

=item C<Get>

    ( $n, $x, $r ) = $diff->Get(qw( min1 max1 range1 ));
    @values = $diff->Get(qw( 0min2 1max2 range2 same base ));

C<Get> returns one or more scalar values.  You pass in a list of the
names of the values you want returned.  Each name must match one of the
following regexes:

    /^(-?\d+)?(min|max)[12]$/i
    /^(range[12]|same|diff|base)$/i

The 1 or 2 after a name says which sequence you want the information
for (and where allowed, it is required).  The optional number before
"min" or "max" is the base to use.  So the following equalities hold:

    $diff->Get('min1') == $diff->Min(1)
    $diff->Get('0min2') == $diff->Min(2,0)

Using C<Get> in a scalar context when you've passed in more than one
name is a fatal error (C<die> is called).

=back

=head2 C<prepare>

Given a reference to a list of items, C<prepare> returns a reference
to a hash which can be used when comparing this sequence to other
sequences with C<LCS> or C<LCS_length>.

    $prep = prepare( \@seq1 );
    for $i ( 0 .. 10_000 )
    {
        @lcs = LCS( $prep, $seq[$i] );
        # do something useful with @lcs
    }

C<prepare> may be passed an optional third parameter; this is a CODE
reference to a key generation function.  See L</KEY GENERATION
FUNCTIONS>.

    $prep = prepare( \@seq1, \&keyGen );
    for $i ( 0 .. 10_000 )
    {
        @lcs = LCS( $seq[$i], $prep, \&keyGen );
        # do something useful with @lcs
    }

Using C<prepare> provides a performance gain of about 50% when calling LCS
many times compared with not preparing.

=head2 C<diff>

    @diffs     = diff( \@seq1, \@seq2 );
    $diffs_ref = diff( \@seq1, \@seq2 );

C<diff> computes the smallest set of additions and deletions necessary
to turn the first sequence into the second, and returns a description
of these changes.  The description is a list of I<hunks>; each hunk
represents a contiguous section of items which should be added,
deleted, or replaced.  (Hunks containing unchanged items are not
included.)

The return value of C<diff> is a list of hunks, or, in scalar context, a
reference to such a list.  If there are no differences, the list will be
empty.

Here is an example.  Calling C<diff> for the following two sequences:

    a b c e h j l m n p
    b c d e f j k l m r s t

would produce the following list:

    (
      [ [ '-', 0, 'a' ] ],

      [ [ '+', 2, 'd' ] ],

      [ [ '-', 4, 'h' ],
        [ '+', 4, 'f' ] ],

      [ [ '+', 6, 'k' ] ],

      [ [ '-',  8, 'n' ],
        [ '-',  9, 'p' ],

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品一区专区| 欧美一区二区三区日韩视频| 99久久伊人精品| 在线免费观看日本欧美| 欧美成人精品高清在线播放 | 丁香桃色午夜亚洲一区二区三区| 成人精品免费网站| 欧美亚洲国产一区二区三区| 精品日韩欧美在线| 国产精品免费视频一区| 亚洲gay无套男同| 成人免费高清在线| 欧美一级精品大片| 亚洲欧美日韩国产综合| 久久99精品国产91久久来源| 99热99精品| 337p日本欧洲亚洲大胆精品| 亚洲精品高清在线| 婷婷六月综合亚洲| 99国产一区二区三精品乱码| 亚洲精品在线网站| 日韩精品一二三四| 色综合久久综合中文综合网| 久久久午夜精品理论片中文字幕| 亚洲成人av免费| 懂色av一区二区在线播放| 制服丝袜在线91| 一个色妞综合视频在线观看| 成人免费看视频| 久久综合色鬼综合色| 亚洲综合成人网| av不卡一区二区三区| 欧美一级欧美一级在线播放| 亚洲图片欧美色图| 97超碰欧美中文字幕| 国产欧美日韩麻豆91| 免费看日韩精品| 欧美日韩激情一区二区三区| 亚洲欧洲国产日本综合| 国产成人免费视频一区| 亚洲精品一区二区三区香蕉| 久久66热re国产| 日韩午夜激情电影| 麻豆91在线播放| 精品久久久久久久人人人人传媒 | 欧美一区二区成人| 亚洲成人综合在线| 在线观看91视频| 亚洲精品视频免费看| av在线不卡电影| 中文字幕av免费专区久久| 高清不卡一区二区在线| 精品国精品国产尤物美女| 美日韩一区二区| 欧美成人女星排行榜| 韩国中文字幕2020精品| 欧美精品一区二区三区在线 | 黄网站免费久久| 日韩视频在线一区二区| 久久国产麻豆精品| 久久综合av免费| 高清不卡一二三区| ㊣最新国产の精品bt伙计久久| 99久久精品国产一区| 亚洲综合免费观看高清完整版在线 | 91精品国产手机| 精品一区二区综合| 国产免费久久精品| 国产精品一区二区三区网站| 久久久亚洲精品一区二区三区| 成人午夜av电影| 亚洲精品国产无天堂网2021| 91美女精品福利| 日韩精品一二区| 欧美国产日韩a欧美在线观看 | 国内精品久久久久影院色| 欧美图片一区二区三区| 午夜视频一区在线观看| 精品av综合导航| 99在线精品观看| 韩国毛片一区二区三区| 亚洲大片精品永久免费| 最新日韩在线视频| 久久九九影视网| 欧美一级一级性生活免费录像| 91女人视频在线观看| 国产成人在线免费| 奇米四色…亚洲| 亚洲狠狠爱一区二区三区| 国产精品国产三级国产aⅴ无密码| 欧美一区二区三区精品| 在线视频欧美区| 色综合中文字幕| 成人性生交大片免费看中文| 美女任你摸久久| 视频一区欧美精品| 亚洲夂夂婷婷色拍ww47| 视频一区在线播放| 综合在线观看色| 中文字幕第一页久久| 日韩亚洲电影在线| 欧美精品久久一区| 在线观看日韩av先锋影音电影院| a在线欧美一区| 成人午夜视频在线| 韩国欧美一区二区| 激情图区综合网| 精品一区二区三区视频| 蜜臀久久久99精品久久久久久| 亚洲成人福利片| 亚洲成人av资源| 亚洲成a人v欧美综合天堂| 亚洲免费av网站| 亚洲精品国产视频| 亚洲综合在线观看视频| 亚洲欧美成人一区二区三区| 亚洲人xxxx| 亚洲国产婷婷综合在线精品| 亚洲成av人片在线观看无码| 亚洲成av人片在线观看无码| 视频一区二区欧美| 日韩在线一区二区| 青青青伊人色综合久久| 日本在线播放一区二区三区| 日韩av一区二区三区| 另类小说色综合网站| 久久成人av少妇免费| 激情综合网激情| 国产成人av电影在线观看| 国产成人99久久亚洲综合精品| 成人黄色在线网站| 色综合久久66| 在线播放一区二区三区| 日韩情涩欧美日韩视频| 久久久久久久国产精品影院| 国产免费观看久久| 亚洲最色的网站| 日韩精品1区2区3区| 激情综合色播五月| 不卡高清视频专区| 欧美午夜不卡在线观看免费| 欧美一区二区在线播放| 欧美激情一区二区在线| 亚洲精品欧美在线| 日本aⅴ精品一区二区三区| 成人免费视频国产在线观看| 在线观看亚洲专区| 精品国产三级电影在线观看| 国产精品网站在线| 亚洲一区在线视频观看| 精品中文字幕一区二区小辣椒| 成人av在线一区二区| 欧美日韩一区二区三区视频| 久久精品人人做人人爽人人| 亚洲理论在线观看| 久久99国产精品尤物| 91福利区一区二区三区| 精品sm在线观看| 亚洲综合另类小说| 成人激情午夜影院| 欧美日韩免费观看一区三区| 欧美激情资源网| 日本三级亚洲精品| 色成年激情久久综合| 精品成人一区二区三区四区| 午夜久久久久久电影| 不卡av在线免费观看| 精品少妇一区二区三区在线播放| 中文字幕一区二区视频| 国精产品一区一区三区mba视频 | 亚洲高清免费一级二级三级| 国产精品一区免费视频| 欧美日韩大陆一区二区| 中文字幕一区二区三区蜜月 | 欧美国产欧美亚州国产日韩mv天天看完整 | 久久精品日产第一区二区三区高清版 | 国产成人午夜片在线观看高清观看| 91毛片在线观看| 中文字幕不卡在线播放| 国内外成人在线视频| 欧美精品18+| 亚洲小说欧美激情另类| 91在线一区二区| 国产女同性恋一区二区| 国产最新精品免费| 精品欧美黑人一区二区三区| 亚洲va韩国va欧美va精品| 99久久免费视频.com| 国产精品麻豆网站| 粉嫩高潮美女一区二区三区| 精品国产亚洲在线| 九色综合狠狠综合久久| 日韩丝袜情趣美女图片| 免费精品视频最新在线| 欧美疯狂性受xxxxx喷水图片| 亚洲电影视频在线| 欧美日韩和欧美的一区二区| 亚洲一级二级三级在线免费观看| 97aⅴ精品视频一二三区| 1024精品合集|