別のキーワード
ライブラリ
- ビルトイン (245)
-
cgi
/ core (22) - continuation (11)
- csv (22)
- fiddle (11)
- matrix (44)
- nkf (11)
- openssl (11)
-
rdoc
/ context (11) -
rexml
/ document (11) -
rubygems
/ requirement (33) -
rubygems
/ version (22) - thread (2)
クラス
-
ARGF
. class (77) - Array (19)
- CGI (22)
- CSV (22)
- Exception (22)
-
Fiddle
:: Function (11) - File (22)
-
Gem
:: Requirement (33) -
Gem
:: Version (22) - Matrix (44)
-
OpenSSL
:: SSL :: Session (11) -
RDoc
:: Context :: Section (11) -
REXML
:: Instruction (11) - Rational (11)
-
RubyVM
:: InstructionSequence (44) - String (19)
モジュール
- Enumerable (22)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) - === (11)
- =~ (11)
- ConditionVariable (11)
- Continuation (11)
-
NEWS for Ruby 2
. 0 . 0 (11) -
NEWS for Ruby 2
. 1 . 0 (11) -
NEWS for Ruby 2
. 3 . 0 (9) -
NEWS for Ruby 2
. 7 . 0 (5) -
NEWS for Ruby 3
. 0 . 0 (4) - NKF (11)
- Requirement (11)
- Win32ネイティブ版Rubyの互換性問題 (11)
-
backtrace
_ locations (11) - disasm (22)
- disassemble (22)
- downcase (8)
- each (33)
-
each
_ line (44) - eigen (11)
- eigensystem (11)
- eql? (11)
- header (11)
- instance (22)
- lstat (22)
- lup (11)
-
lup
_ decomposition (11) - new (11)
- out (11)
- pack (19)
- pack テンプレート文字列 (11)
- partition (22)
-
ruby 1
. 6 feature (11) -
ruby 1
. 8 . 2 feature (11) -
ruby 1
. 8 . 3 feature (11) -
ruby 1
. 8 . 4 feature (11) -
ruby 1
. 9 feature (11) -
satisfied
_ by? (11) - unpack (11)
- 制御構造 (11)
検索結果
先頭5件
-
Gem
:: Requirement # satisfied _ by?(version) -> bool (12300.0) -
引数 version が自身に含まれる全ての必要条件を満たす場合に true を返します。 そうでなければ、false を返します。
...version が自身に含まれる全ての必要条件を満たす場合に true を返します。
そうでなければ、false を返します。
@param version Gem::Version のインスタンスを指定します。
//emlist[][ruby]{
req = Gem::Requirement.new("~> 3.2.1")
p req.satisfied_by?(......Gem::Version.new('3.2.9')) # => true
p req.satisfied_by?(Gem::Version.new('3.3.0')) # => false
//}... -
Thread
:: ConditionVariable (12048.0) -
スレッドの同期機構の一つである状態変数を実現するクラスです。
...一つである状態変数を実現するクラスです。
以下も ConditionVariable を理解するのに参考になります。
https://ruby-doc.com/docs/ProgrammingRuby/html/tut_threads.html#UF
=== Condition Variable とは
あるスレッド A が排他領域で動いていたとしま......状況を解決するのが Condition Variable です。
スレッド a で条件(リソースが空いているかなど)が満たされるまで wait メソッドで
スレッドを止めます。他のスレッド b において条件が満たされたなら signal
メソッドでスレッド a......= Mutex.new
cv = ConditionVariable.new
a = Thread.start {
mutex.synchronize {
...
while (条件が満たされない)
cv.wait(mutex)
end
...
}
}
b = Thread.start {
mutex.synchronize {
# 上の条... -
Continuation (12030.0)
-
継続を表すクラスです。
...。cont は、Continuation クラスのインスタ
ンスで、Continuation#call メソッドを実行するこ
とでいつでも記憶した状態を継続することができます。
C 言語の setjmp()/longjmp() がわかる人は
setjmp() == callcc {|c| }
longjmp() == c.call
と考え......callcc() は、ブロックの戻り値を返しますが、Continuation#call(args)
が呼び出されたときは args を返します。
例:
以下は、Continuationによる無限ループの例
def LOOP
c = nil
yield callcc {|cnt| c = cnt; true }
c.call(false)
end
L......OOP {|v| p v}
=> true
false
false
false
:
:
callcc とは、call-with-current-continuation の略です。... -
Matrix
# lup _ decomposition -> Matrix :: LUPDecomposition (9506.0) -
行列の LUP 分解を保持したオブジェクトを返します。
...Matrix::LUPDecomposition は to_ary を定義しているため、
多重代入によって3つの行列(下三角行列、上三角行列、置換行列)
を得ることができます。これを [L, U, P] と書くと、
L*U = P*self を満たします。
//emlist[例][ruby]{
require 'matrix'
a......= Matrix[[1, 2], [3, 4]]
l, u, p = a.lup
l.lower_triangular? # => true
u.upper_triangular? # => true
p.permutation? # => true
l * u == p * a # => true
a.lup.solve([2, 5]) # => Vector[(1/1), (1/2)]
//}
@see Matrix::LUPDecomposition... -
Gem
:: Requirement # =~(version) -> bool (9300.0) -
引数 version が自身に含まれる全ての必要条件を満たす場合に true を返します。 そうでなければ、false を返します。
...version が自身に含まれる全ての必要条件を満たす場合に true を返します。
そうでなければ、false を返します。
@param version Gem::Version のインスタンスを指定します。
//emlist[][ruby]{
req = Gem::Requirement.new("~> 3.2.1")
p req.satisfied_by?(......Gem::Version.new('3.2.9')) # => true
p req.satisfied_by?(Gem::Version.new('3.3.0')) # => false
//}... -
RubyVM
:: InstructionSequence . disasm(body) -> String (9230.0) -
引数 body で指定したオブジェクトから作成した RubyVM::InstructionSequence オブジェクトを人間が読める形式の文字 列に変換して返します。
...::InstructionSequence オブジェクトを人間が読める形式の文字
列に変換して返します。
@param body Proc、Method オブジェクトを指定します。
例1:Proc オブジェクトを指定した場合
# /tmp/proc.rb
p = proc { num = 1 + 2 }
puts RubyVM::Instruction......isasm(p)
出力:
== disasm: <RubyVM::InstructionSequence:block in <main>@/tmp/proc.rb>===
== catch table
| catch type: redo st: 0000 ed: 0012 sp: 0000 cont: 0000
| catch type: next st: 0000 ed: 0012 sp: 0000 cont: 0012
|----------------------------------------------------------------......--------
local table (size: 2, argc: 0 [opts: 0, rest: -1, post: 0, block: -1] s1)
[ 2] num
0000 trace 1 ( 1)
0002 putobject 1
0004 putobject 2
0006 opt_plus <ic:1>
0008 dup
0009 setlocal num, 0... -
RubyVM
:: InstructionSequence . disassemble(body) -> String (9230.0) -
引数 body で指定したオブジェクトから作成した RubyVM::InstructionSequence オブジェクトを人間が読める形式の文字 列に変換して返します。
...::InstructionSequence オブジェクトを人間が読める形式の文字
列に変換して返します。
@param body Proc、Method オブジェクトを指定します。
例1:Proc オブジェクトを指定した場合
# /tmp/proc.rb
p = proc { num = 1 + 2 }
puts RubyVM::Instruction......isasm(p)
出力:
== disasm: <RubyVM::InstructionSequence:block in <main>@/tmp/proc.rb>===
== catch table
| catch type: redo st: 0000 ed: 0012 sp: 0000 cont: 0000
| catch type: next st: 0000 ed: 0012 sp: 0000 cont: 0012
|----------------------------------------------------------------......--------
local table (size: 2, argc: 0 [opts: 0, rest: -1, post: 0, block: -1] s1)
[ 2] num
0000 trace 1 ( 1)
0002 putobject 1
0004 putobject 2
0006 opt_plus <ic:1>
0008 dup
0009 setlocal num, 0... -
Gem
:: Version :: Requirement -> Class (9206.0) -
Gem::Requirement のエイリアスです。
...Gem::Requirement のエイリアスです。
//emlist[][ruby]{
p Gem::Version::Requirement == Gem::Requirement # => true
//}... -
RubyVM
:: InstructionSequence # disasm -> String (9206.0) -
self が表す命令シーケンスを人間が読める形式の文字列に変換して返します。
...ubyVM::InstructionSequence.compile('1 + 2').disasm
出力:
== disasm: <RubyVM::InstructionSequence:<compiled>@<compiled>>==========
0000 trace 1 ( 1)
0002 putobject 1
0004 putobject 2
0006 opt_plus <ic:1>......0008 leave
@see RubyVM::InstructionSequence.disasm... -
RubyVM
:: InstructionSequence # disassemble -> String (9206.0) -
self が表す命令シーケンスを人間が読める形式の文字列に変換して返します。
...ubyVM::InstructionSequence.compile('1 + 2').disasm
出力:
== disasm: <RubyVM::InstructionSequence:<compiled>@<compiled>>==========
0000 trace 1 ( 1)
0002 putobject 1
0004 putobject 2
0006 opt_plus <ic:1>......0008 leave
@see RubyVM::InstructionSequence.disasm...