るりまサーチ

最速Rubyリファレンスマニュアル検索!
231件ヒット [1-100件を表示] (0.200秒)
トップページ > クエリ:-[x] > クエリ:u[x] > クエリ:upto[x]

別のキーワード

  1. _builtin -
  2. open-uri open
  3. irb/input-method new
  4. irb/input-method gets
  5. matrix -

ライブラリ

クラス

モジュール

キーワード

検索結果

<< 1 2 3 > >>

Integer#upto(max) -> Enumerator (24308.0)

self から max まで 1 ずつ増やしながら繰り返します。 self > max であれば何もしません。

...self から max まで 1 ずつ増やしながら繰り返します。
self > max であれば何もしません。

@param max 数値
@return self を返します。

//emlist[][ruby]{
5.upto(10) {|i| print i, " " } # => 5 6 7 8 9 10
//}

@see Integer#downto, Numeric#step, Integer#times...

Integer#upto(max) {|n| ... } -> Integer (24308.0)

self から max まで 1 ずつ増やしながら繰り返します。 self > max であれば何もしません。

...self から max まで 1 ずつ増やしながら繰り返します。
self > max であれば何もしません。

@param max 数値
@return self を返します。

//emlist[][ruby]{
5.upto(10) {|i| print i, " " } # => 5 6 7 8 9 10
//}

@see Integer#downto, Numeric#step, Integer#times...

String#upto(max, exclusive = false) {|s| ... } -> self (24307.0)

self から始めて max まで 「次の文字列」を順番にブロックに与えて繰り返します。 「次」の定義については String#succ を参照してください。

...#succ を参照してください。

たとえば以下のコードは a, b, c, ... z, aa, ... az, ..., za を
出力します。

//emlist[][ruby]{
("a" .. "za").each do |str|
puts str
end
'a'.upto('za') do |str|
puts str
end
//}

@param max 繰り返しをやめる文字列

@param exclusi...

Date#upto(max) -> Enumerator (24302.0)

このメソッドは、step(max, 1){|date| ...} と等価です。

このメソッドは、step(max, 1){|date| ...} と等価です。

@param max 日付オブジェクト

@see Date#step, Date#downto

Date#upto(max) {|date| ...} -> self (24302.0)

このメソッドは、step(max, 1){|date| ...} と等価です。

このメソッドは、step(max, 1){|date| ...} と等価です。

@param max 日付オブジェクト

@see Date#step, Date#downto

絞り込み条件を変える

Syslog::Macros.#LOG_UPTO(priority) -> Integer (12307.0)

priorityまでのすべての優先度のマスクを作成します。

...のすべての優先度のマスクを作成します。

@param priority priority は優先度を示す定数を指定します。
詳しくは、Syslog::Levelを参照してください。

例:
require 'syslog'
Syslog.mask = Syslog::LOG_UPTO(Syslog::LOG_ERR)...

FileUtils.#uptodate?(newer, older_list, options = nil) -> bool (12300.0)

newer が、older_list に含まれるすべてのファイルより新しいとき真。 存在しないファイルは無限に古いとみなされます。

...@param options どのようなオプションも指定することはできません。

@raise ArgumentError options にオプションを指定した場合に発生します。

//emlist[][ruby]{
require 'fileutils'
FileUtils.uptodate?('hello.o', ['hello.c', 'hello.h']) or system('make')
//}...

Numeric (8184.0)

数値を表す抽象クラスです。Integer や Float などの数値クラス は Numeric のサブクラスとして実装されています。

...
は Numeric のサブクラスとして実装されています。

演算や比較を行うメソッド(+, -, *, /, <=>)は Numeric のサブクラスで定義されま
す。Numeric で定義されているメソッドは、サブクラスで提供されているメソッド
(+, -, *, /, %)...
...を利用して定義されるものがほとんどです。
つまり Numeric で定義されているメソッドは、Numeric のサブクラスとして新たに数値クラスを定義した時に、
演算メソッド(+, -, *, /, %, <=>, coerce)だけを定義すれば、数値クラスのそ...
...o - - o o -
Numeric Integer Fixnum Bignum Float Rational Complex
-
------------------------------------------------------------------------------------------
upto
| -...
...o - -
to_r | - o o o o
to_s | - o o o o
truncate | o o o o -
upto
| -...

ruby 1.9 feature (4932.0)

ruby 1.9 feature ruby version 1.9.0 は開発版です。 以下にあげる機能は将来削除されたり互換性のない仕様変更がなされるかもしれません。 1.9.1 以降は安定版です。 バグ修正がメインになります。

...ruby 1.9 feature
ruby version 1.9.0 は開発版です。
以下にあげる機能は将来削除されたり互換性のない仕様変更がなされるかもしれません。
1.9.1 以降は安定版です。
バグ修正がメインになります。

記号について(特に重要なもの...
...hal ファイルのフォーマット変更
* レベル
* [bug]: バグ修正
* [new]: 追加されたクラス/メソッドなど
* [compat]: 変更されたクラス/メソッドなど(互換性のある変更) (only backward-compatibility) (影響の範囲が小さいと思われる変...
...== 2006-03-21

: MatchData#[] [compat]

名前による参照
((<ruby-dev:28446>))

=== 2006-03-03

: FileUtils.cp_r [lib] [compat]

remove_destination オプションの追加
((<ruby-dev:28417>))

=== 2006-02-15

: instance_eval

((<ruby-core:7365>))

=== 2006-02-03

: Integer#upto [com...

Enumerable#max_by -> Enumerator (3212.0)

各要素を順番にブロックに渡して実行し、 その評価結果を <=> で比較して、 最大であった値に対応する元の要素、もしくは最大の n 要素が降順で入った配列を返します。

...返すかは不定です。

Enumerable#max と Enumerable#max_by の
違いは Enumerable#sort と Enumerable#sort_by の違いと同じです。

ブロックを省略した場合は Enumerator を返します。

@param n 取得する要素数。

//emlist[例][ruby]{
a = %w(albatross dog horse)...
...module Enumerable
# weighted random sampling.
#
# Pavlos S. Efraimidis, Paul G. Spirakis
# Weighted random sampling with a reservoir
# Information Processing Letters
# Volume 97, Issue 5 (16 March 2006)
def wsample(n)
self.max_by(n) {|v| rand ** (1.0/yield(v)) }
end
end
e = (-20....
....20).to_a*10000
a = e.wsample(20000) {|x|
Math.exp(-(x/5.0)**2) # normal distribution
}
# a is 20000 samples from e.
p a.length #=> 20000
h = a.group_by {|x| x }
-
10.upto(10) {|x| puts "*" * (h[x].length/30.0).to_i if h[x] }
#=> *
# ***
# ******
# ***********
# ******************
# *****...

絞り込み条件を変える

<< 1 2 3 > >>