るりまサーチ

最速Rubyリファレンスマニュアル検索!
169件ヒット [101-169件を表示] (0.028秒)
トップページ > クエリ:array[x] > クエリ:sample[x]

別のキーワード

  1. array fill
  2. array []
  3. array slice
  4. array slice!

ライブラリ

クラス

モジュール

検索結果

<< < 1 2 >>

NEWS for Ruby 2.3.0 (78.0)

NEWS for Ruby 2.3.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...k は IO#read_nonblock と同じように `exception: false' オプションをサポートします
11358

* Array
* Array#bsearch_index を追加
10730
* Array#dig を追加
11643

* Comparable
* Comparable#==はもはや例外を rescue しません
7688...
...nSequence
* 実験的な機能としてiseqローダー用の低レベルな操作をするメソッドをいくつか追加
使用例は sample/iseq_loader.rb を見てください。
ローダーには検証機能がないので、編集したバイナリや壊れたバイナリを...
...とバグ修正を除く)

* Array
* Array#select!, Array#keep_if, Array#reject!, Array#delete_if
ブロックが評価される度にレシーバーの配列をすぐに変更しないようになりました。
10714
* Array#flatten と Array#flatten! は与えられたレベ...

ruby 1.8.4 feature (42.0)

ruby 1.8.4 feature ruby 1.8.4 での ruby 1.8.3 からの変更点です。

...hange]>))
* ((<ruby 1.8.4 feature/File.dirname (Win全般) [bug]>))
* ((<ruby 1.8.4 feature/File::Stat#pipe? [bug]>))
* ((<ruby 1.8.4 feature/Array#fill [bug]>))
* ((<ruby 1.8.4 feature/String#scan [bug]>))
* ((<ruby 1.8.4 feature/File.join [bug]>))
* ((<ruby 1.8.4 feature/Thread#pass [b...
...ていたのを修正。

: Array#fill [bug]

#Tue Nov 15 14:39:16 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
#
# * array.c (rb_ary_fill): should adjust array length correctly when
# an array is expanded in the fill process. [ruby-core:06625]

Array
に対してfillとpopを繰...
...の変更履歴は
ext/tk/ChangeLog.tkextlib
を参照してください.

* サンプルスクリプト

: ext/tk/sample/scrollframe.rb [new]

配置したウィジェットの表示範囲をスクロールすることが
できるようなスクロ...

CSV (30.0)

このクラスは CSV ファイルやデータに対する完全なインターフェイスを提供します。

...SV_TEXT
Ruby,1995
Rust,2010
CSV_TEXT

IO.write "sample.csv", csv_text

# ファイルから一行ずつ
CSV.foreach("sample.csv") do |row|
p row
end
# => ["Ruby", "1995"]
# ["Rust", "2010"]

# ファイルから一度に
p CSV.read("sample.csv")
# => [["Ruby", "1995"], ["Rust", "2010"]]

#...
...<< ["another", "row"]
# ...
end
//}

=== 一行変換

//emlist[][ruby]{
require 'csv'

csv_string = ["CSV", "data"].to_csv # => "CSV,data"
csv_array = "CSV,String".parse_csv # => ["CSV", "String"]
//}

=== ショートカット

//emlist[][ruby]{
require 'csv'

CSV { |csv_out| cs...
...data is never transcoded
(unless you ask Ruby to transcode it for you) and will literally be parsed in
the Encoding it is in. Thus CSV will return Arrays or Rows of Strings in the
Encoding of your data. This is accomplished by transcoding the parser itself
into your Encoding.

Some transcoding mus...

Random#rand -> Float (18.0)

一様な擬似乱数を発生させます。

...ように見える

# 上と同じ種で再初期化
prng = Random.new(1234)
srand(1234)
# Kernel.#rand は Array#sample などの影響を受けて値がずれることがある
[0, 1].sample
prng.rand #=> 0.1915194503788923
rand #=> 0.6221087710398319
//}


@see Kernel...

Random#rand(max) -> Integer | Float (18.0)

一様な擬似乱数を発生させます。

...ように見える

# 上と同じ種で再初期化
prng = Random.new(1234)
srand(1234)
# Kernel.#rand は Array#sample などの影響を受けて値がずれることがある
[0, 1].sample
prng.rand #=> 0.1915194503788923
rand #=> 0.6221087710398319
//}


@see Kernel...

絞り込み条件を変える

Random#rand(range) -> Integer | Float (18.0)

一様な擬似乱数を発生させます。

...ように見える

# 上と同じ種で再初期化
prng = Random.new(1234)
srand(1234)
# Kernel.#rand は Array#sample などの影響を受けて値がずれることがある
[0, 1].sample
prng.rand #=> 0.1915194503788923
rand #=> 0.6221087710398319
//}


@see Kernel...

profile (18.0)

Ruby プログラムのためのプロファイラです。 プロファイラとは効率改善のための調査に用いられるツールのことです。 profile ライブラリは各メソッドの実行時間に関する統計を出力します。

...間と呼ぶことにします。

=== 出力の意味

プロファイルの結果は例えば次のようになります。

$ ruby -r profile sample/sieve.rb 1000
2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47 … 略 …
% cumulative self self total
time...
....65 214.49 Fixnum#step
31.38 2.88 1.38 2410 0.57 0.57 Array#[]=
27.84 4.10 1.23 2 613.28 2070.31 Range#each
4.26 4.29 0.19 1 187.50 234.38 Array#join
1.06 4.34 0.05 168 0.28 0.28 Fixnum#to_s
0....
<< < 1 2 >>