=1B$B$`$i$?$G$9!#=1B(B

dev =1B$B$K1Q8l$GEj9F$7$F$7$^$$$^$7$?!#$4$a$s$J$5$$!#=1B(B
=1B$BL5M}$7$F1Q8l$G=3Dq$$$FEj9F@h$r=1B(B core =
=1B$B$K$7$F$$$?$H;W$C$F$$$?$N$G$9$,!&!&!&=1B(B

On 2010/08/03, at 13:13, Kenta Murata wrote:

> Feature #3647: Array#sample(n, replace=3Dfalse)
> http://redmine.ruby-lang.org/issues/show/3647
>=20
> =1B$B5/I<<T=1B(B: Kenta Murata
> =1B$B%9%F!<%?%9=1B(B: Open, =1B$BM%@hEY=1B(B: Normal
> =1B$B%+%F%4%j=1B(B: core, Target version: 1.9.x
>=20
> Array#sample does not support sampling with replacement directly, so =
we must write codes like the following to obtain samples with =
replacement.
>=20
>  samples_with_replacement =3D n.times.map { source.sample }
>=20
> If Array#sample has the argument for switching with/without =
replacement, we can write it as follow.
>=20
>  samples_with_replacement =3D source.sample(n, true)

=1B$B$3$NDs0F$O!"=1B(BArray#sample =
=1B$B%a%=3D%C%I$GI|85Cj=3DP$b$G$-$k$h$&$K$7$?$$$H$$$&;v$G$9!#=1B(B
=1B$BF1MM$N%$%s%?%U%'!<%9$r;}$DNc$H$7$F=1B(B R =1B$B$N=1B(B sample =
=1B$B4X?t$,$"$j$^$9!#=1B(B


--
Kenta Murata
OpenPGP FP =3D 1D69 ADDE 081C 9CC2 2E54  98C1 CEFE 8AFB 6081 B062

=1B$BK\$r=3Dq$-$^$7$?=1B(B!!
=1B$B!X=1B(BRuby =1B$B5U0z$-%l%7%T!Y=1B(B =
http://www.amazon.co.jp/dp/4798119881/mrkn-22

E-mail: mrkn / mrkn.jp
twitter: http://twitter.com/mrkn/
blog: http://d.hatena.ne.jp/mrkn/