クラス
-
OpenSSL
:: BN (1) - Socket (1)
- StringScanner (4)
モジュール
-
CGI
:: HtmlExtension (3) - Kernel (4)
キーワード
-
check
_ signedness (2) -
check
_ sizeof (2) -
check
_ until (1) - checkbox (2)
-
connect
_ nonblock (1) -
prime
_ fasttest? (1) -
scan
_ full (1) -
search
_ full (1)
検索結果
先頭5件
- StringScanner
# check(regexp) -> String | nil - Kernel
# check _ signedness(type , headers = nil , opts = nil) -> "signed" | "unsigned" | nil - Kernel
# check _ signedness(type , headers = nil , opts = nil) { . . . } -> "signed" | "unsigned" | nil - CGI
:: HtmlExtension # checkbox(name = "" , value = nil , checked = nil) -> String - Kernel
# check _ sizeof(type , headers = nil) -> Integer | nil
-
StringScanner
# check(regexp) -> String | nil (54730.0) -
現在位置から regexp とのマッチを試みます。 マッチに成功したらマッチした部分文字列を返します。 マッチに失敗したら nil を返します。
現在位置から regexp とのマッチを試みます。
マッチに成功したらマッチした部分文字列を返します。
マッチに失敗したら nil を返します。
このメソッドはマッチが成功してもスキャンポインタを進めません。
@param regexp マッチに用いる正規表現を指定します。
//emlist[例][ruby]{
require 'strscan'
s = StringScanner.new('test string')
s.check(/\w+/) # => "test"
s.pos # => 0
s.matched # => "test"
s.check(... -
Kernel
# check _ signedness(type , headers = nil , opts = nil) -> "signed" | "unsigned" | nil (19324.0) -
Returns the signedness of the given +type+. You may optionally specify additional +headers+ to search in for the +type+. If the +type+ is found and is a numeric type, a macro is passed as a preprocessor constant to the compiler using the +type+ name, in uppercase, prepended with 'SIGNEDNESS_OF_', followed by the +type+ name, followed by '=X' where 'X' is positive integer if the +type+ is unsigned, or negative integer if the +type+ is signed. For example, if size_t is defined as unsigned, then check_signedness('size_t') would returned +1 and the SIGNEDNESS_OF_SIZE_T=+1 preprocessor macro would be passed to the compiler, and SIGNEDNESS_OF_INT=-1 if check_signedness('int') is done.
Returns the signedness of the given +type+. You may optionally
specify additional +headers+ to search in for the +type+.
If the +type+ is found and is a numeric type, a macro is passed as a
preprocessor constant to the compiler using the +type+ name, in
uppercase, prepended with 'SIGNEDNESS... -
Kernel
# check _ signedness(type , headers = nil , opts = nil) { . . . } -> "signed" | "unsigned" | nil (19324.0) -
Returns the signedness of the given +type+. You may optionally specify additional +headers+ to search in for the +type+. If the +type+ is found and is a numeric type, a macro is passed as a preprocessor constant to the compiler using the +type+ name, in uppercase, prepended with 'SIGNEDNESS_OF_', followed by the +type+ name, followed by '=X' where 'X' is positive integer if the +type+ is unsigned, or negative integer if the +type+ is signed. For example, if size_t is defined as unsigned, then check_signedness('size_t') would returned +1 and the SIGNEDNESS_OF_SIZE_T=+1 preprocessor macro would be passed to the compiler, and SIGNEDNESS_OF_INT=-1 if check_signedness('int') is done.
Returns the signedness of the given +type+. You may optionally
specify additional +headers+ to search in for the +type+.
If the +type+ is found and is a numeric type, a macro is passed as a
preprocessor constant to the compiler using the +type+ name, in
uppercase, prepended with 'SIGNEDNESS... -
CGI
:: HtmlExtension # checkbox(name = "" , value = nil , checked = nil) -> String (19210.0) -
タイプが checkbox である input 要素を生成します。
タイプが checkbox である input 要素を生成します。
@param name name 属性の値を指定します。
@param value value 属性の値を指定します。
@param checked checked 属性の値を指定します。
例:
checkbox("name", "value", true)
# => "<INPUT CHECKED NAME=\"name\" TYPE=\"checkbox\" VALUE=\"value\">" -
Kernel
# check _ sizeof(type , headers = nil) -> Integer | nil (18958.0) -
与えられた型のサイズを返します。
与えられた型のサイズを返します。
型 type がシステムに存在する場合は、グローバル変数 $defs に
"-DSIZEOF_type=X" を追加し、型のサイズを返します。型 type がシステムに
存在しない場合は、nil を返します。
例えば、
require 'mkmf'
check_sizeof('mystruct') # => 12
である場合、SIZEOF_MYSTRUCT=12 というプリプロセッサマクロをコンパイラに渡します。
@param type 検査したい型を指定します。
@param headers 追加のヘッダファイルを指定します。 -
Kernel
# check _ sizeof(type , headers = nil) { . . . } -> Integer | nil (18958.0) -
与えられた型のサイズを返します。
与えられた型のサイズを返します。
型 type がシステムに存在する場合は、グローバル変数 $defs に
"-DSIZEOF_type=X" を追加し、型のサイズを返します。型 type がシステムに
存在しない場合は、nil を返します。
例えば、
require 'mkmf'
check_sizeof('mystruct') # => 12
である場合、SIZEOF_MYSTRUCT=12 というプリプロセッサマクロをコンパイラに渡します。
@param type 検査したい型を指定します。
@param headers 追加のヘッダファイルを指定します。 -
StringScanner
# check _ until(regexp) -> String | nil (18676.0) -
regexp が一致するまで文字列をスキャンします。 マッチに成功したらスキャン開始位置からマッチ部分の末尾までの部分文字列を返します。 マッチに失敗したら nil を返します。
regexp が一致するまで文字列をスキャンします。
マッチに成功したらスキャン開始位置からマッチ部分の末尾までの部分文字列を返します。
マッチに失敗したら nil を返します。
このメソッドはマッチが成功してもスキャンポインタを進めません。
@param regexp マッチに用いる正規表現を指定します。
//emlist[例][ruby]{
require 'strscan'
s = StringScanner.new('test string')
s.check_until(/str/) # => "test str"
s.matched # => "str... -
CGI
:: HtmlExtension # checkbox(attributes) -> String (18310.0) -
タイプが checkbox である input 要素を生成します。
タイプが checkbox である input 要素を生成します。
@param attributes 属性をハッシュで指定します。
例:
checkbox("name" => "name", "value" => "value", "checked" => true)
# => "<INPUT checked name=\"name\" TYPE=\"checkbox\" value=\"value\">" -
CGI
:: HtmlExtension # radio _ button(name = "" , value = nil , checked = nil) -> String (910.0) -
タイプが radio である input 要素を生成します。
タイプが radio である input 要素を生成します。
@param name name 属性の値を指定します。
@param value value 属性の値を指定します。
@param checked 真ならば checked 属性を設定します。
例:
radio_button("name", "value")
# <INPUT TYPE="radio" NAME="name" VALUE="value">
radio_button("name", "value", true)
# <INPUT TYPE="radio" NAME="name" ... -
OpenSSL
:: BN # prime _ fasttest?(checks=nil , vtrivdiv=true) -> bool (661.0) -
自身が素数であるなら true を返します。
自身が素数であるなら true を返します。
vtrivdiv が真である場合には、 Miller-Rabin 法での
判定の前に小さな素数で割ることで素数か否かを
調べます。自身が小さな素数である場合にはこの手順
により素数ではないと誤った返り値を返します。
Miller-Rabin 法により確率的に判定します。
checksで指定した回数だけ繰り返します。
checksがnilである場合は OpenSSL が適切な
回数を判断します。
//emlist[][ruby]{
require 'openssl'
# 181 は 「小さな素数」である
OpenSSL::BN.new("18... -
StringScanner
# scan _ full(regexp , s , f) -> object (58.0) -
スキャンポインタの位置から regexp と文字列のマッチを試します。
スキャンポインタの位置から regexp と文字列のマッチを試します。
マッチに成功すると、s と f の値によって以下のように動作します。
* s が true ならばスキャンポインタを進めます。
* s が false ならばスキャンポインタを進めません。
* f が true ならばマッチした部分文字列を返します。
* f が false ならばマッチした部分文字列の長さを返します。
マッチに失敗すると s や f に関係なく nil を返します。
このメソッドは s と f の組み合わせにより、
他のメソッドと同等の動作になります。
*... -
StringScanner
# search _ full(regexp , s , f) -> object (58.0) -
regexp で指定された正規表現とマッチするまで文字列をスキャンします。
regexp で指定された正規表現とマッチするまで文字列をスキャンします。
マッチに成功すると、s と f の値によって以下のように動作します。
* s が true ならばスキャンポインタを進めます。
* s が false ならばスキャンポインタを進めません。
* f が true ならばスキャン開始位置からマッチした部分の末尾までの部分文字列を返します。
* f が false ならばスキャン開始位置からマッチした部分の末尾までの部分文字列の長さを返します。
マッチに失敗すると s や f に関係なく nil を返します。
このメソッドは s と ... -
Socket
# connect _ nonblock(server _ sockaddr) -> 0 (40.0) -
ソケットをノンブロッキングモードに設定した後、 connect(2) を呼び出します。
ソケットをノンブロッキングモードに設定した後、
connect(2) を呼び出します。
引数、返り値は Socket#connect と同じです。
connect が EINPROGRESS エラーを報告した場合、その例外(Errno::EINPROGRESS)
には IO::WaitWritable が Object#extend されます。
これを connect_nonblock をリトライするために使うことができます。
# Pull down Google's web page
require 'socket'
include Socket::Constants
...