るりまサーチ

最速Rubyリファレンスマニュアル検索!
77件ヒット [1-77件を表示] (0.042秒)

別のキーワード

  1. openssl integer
  2. asn1 integer
  3. _builtin integer
  4. integer downto
  5. integer upto

ライブラリ

クラス

モジュール

キーワード

検索結果

String#count(*chars) -> Integer (18244.0)

chars で指定された文字が文字列 self にいくつあるか数えます。

...cdefg'.count('c') # => 1
p '123456789'.count('2378') # => 4
p '123456789'.count('2-8', '^4-6') # => 4

# ファイルの行数を数える
n_lines = File.read("foo").count("\n")

# ファイルの末尾に改行コードがない場合にも対処する
buf = File.read("foo"...
...)
n_lines = buf.count("\n")
n_lines += 1 if /[^\n]\z/ =~ buf
# if /\n\z/ !~ buf だと空ファイルを 1 行として数えてしまうのでダメ
//}...

Socket::Constants::SO_NREAD -> Integer (6217.0)

@todo Get first packet byte count。

...@todo
Get first packet byte count...

Socket::SO_NREAD -> Integer (6217.0)

@todo Get first packet byte count。

...@todo
Get first packet byte count...

Thread#priority -> Integer (3149.0)

スレッドの優先度を返します。この値が大きいほど優先度が高くなります。 メインスレッドのデフォルト値は 0 です。新しく生成されたスレッドは親スレッドの priority を引き継ぎます。

...ist[例][ruby]{
Thread.current.priority # => 0

count
1 = count2 = 0
a = Thread.new do
loop { count1 += 1 }
end
a.priority = -1

b = Thread.new do
loop { count2 += 1 }
end
b.priority = -2
count
1 = count2 = 0 # reset
sleep 1 # => 1
count
1 # => 13809431
count
2 # => 1157192...

Thread#priority=(val) (3049.0)

スレッドの優先度を返します。この値が大きいほど優先度が高くなります。 メインスレッドのデフォルト値は 0 です。新しく生成されたスレッドは親スレッドの priority を引き継ぎます。

...ist[例][ruby]{
Thread.current.priority # => 0

count
1 = count2 = 0
a = Thread.new do
loop { count1 += 1 }
end
a.priority = -1

b = Thread.new do
loop { count2 += 1 }
end
b.priority = -2
count
1 = count2 = 0 # reset
sleep 1 # => 1
count
1 # => 13809431
count
2 # => 1157192...

絞り込み条件を変える

ruby 1.6 feature (54.0)

ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。

...02-13) [i586-linux]
Errno::EAGAIN
Errno::EAGAIN

== 1.6.7 (2002-03-01) -> 1.6.8 (2002-12-24)

: 2002-10-02: Thread (cygwin)

Cygwin で、Thread の切替えが行われないことがありました。
((<ruby-list:36058>)), ((<ruby-list:24637>))

: 2002-10-01: Socket (win...
...from -:2
ruby 1.6.7 (2002-07-30) [i586-linux]

: 2002-06-03 sprintf()

"%d" で引数を整数にするときに、((<組み込み関数/Integer>)) と同じ規則を
使用するようになりました。

p sprintf("%d", nil)

=> -:1:in `sprintf': no implicit conversio...
...様に rescue, ensure 節の指定が可能になりました

obj = Object.new
def obj.foo
rescue
ensure
end

: ((<String>))#count
: ((<String>))#delete
: ((<String>))#squeeze
: ((<String>))#tr
: ((<String>))#tr_s
'\-' で '-' を指定可能になりました(tr! 等、bang m...

NEWS for Ruby 2.1.0 (24.0)

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

...E_MIN (RUBY_GC_HEAP_FREE_SLOTS を代わりに使います)
* RUBY_HEAP_MIN_SLOTS (RUBY_GC_HEAP_INIT_SLOTS を代わりに使います)

* Integer
* 追加: Fixnum#bit_length
* 追加: Bignum#bit_length
* Bignum の性能向上
* GMP をいくつかの操作で使えると...
...* 拡張: IO#seek 第2引数としてシンボルを受け付けるようになりました (:CUR, :END, :SET, :DATA, :HOLE)
* 拡張: IO#read_nonblock シンボルを返すためにキーワード引数 `exception: false` を受け付けるようになりました
* 拡張: IO#write_no...
...ArgumentError が発生します。

=== C API の更新

* 非推奨: rb_gc_set_params() Ruby内部でのみ使います。

* 追加: rb_gc_count() GCが発生した回数を返します。

* 追加: rb_gc_stat() GC.stat が返す値にオーバーヘッドなしにアクセスできます...