33件ヒット
[1-33件を表示]
(0.041秒)
キーワード
- bigdecimal (11)
-
net
/ smtp (11) -
rubygems
/ security (11)
検索結果
-
rubygems
/ security (37.0) -
このライブラリは暗号署名を RubyGems パッケージに使用するために使用します。
...以下のように "-P HighSecurity" オプションを
付けて Gem をインストールしてみてください。
# install the gem with using the security policy "HighSecurity"
$ sudo gem install Imlib2-Ruby-0.5.0.gem -P HighSecurity
この -P オプションはセキュリティポリ......することが出来ます。さあ、上述の
インストールコマンドをもう一度実行してください。
# install the gem with using the HighSecurity policy
# (今度はなんの問題もありません)
$ sudo gem install Imlib2-Ruby-0.5.0.gem -P HighSecurity
今回は、R......追加します。
-l, --list 信頼している証明書のリストを表示します。
-r, --remove STRING STRING を含む証明書を削除します。
-b, --build EMAIL_ADDR EMAIL_ADDR に対する秘密鍵や自己署名証明書... -
net
/ smtp (31.0) -
メールを送信するためのプロトコル SMTP (Simple Mail Transfer Protocol) を扱うライブラリです。
...rom@example.com>
To: Dest Address <to@example.net>
Subject: test mail
Date: Sat, 23 Jun 2001 16:26:43 +0900
Message-Id: <unique.message.id.string@yourhost.example.com>
This is a test mail.
EndOfMail
}
==== セッションを終了する
メールを送ったら Net::SMTP#finish......。
File のように GC 時に勝手に close されることもありません。
# using SMTP#finish
require 'net/smtp'
smtp = Net::SMTP.start('smtp.example.com', 25)
smtp.send_message mail_string, 'from@example.com', 'to@example.net'
smtp.finish
またブロック付きの Net::SMTP.......能な限りブロック付きの start を使うのがよいでしょう。
# using block form of SMTP.start
require 'net/smtp'
Net::SMTP.start('smtp.example.com', 25) {|smtp|
smtp.send_message mail_string, 'from@example.com', 'to@example.net'
}
==== 文字列以外からの送信... -
bigdecimal (19.0)
-
bigdecimal は浮動小数点数演算ライブラリです。 任意の精度で 10 進表現された浮動小数点数を扱えます。
...に自動変換することはできません。
文字列を数値に自動変換したい場合は bigdecimal.c の
「/* #define ENABLE_NUMERIC_STRING */」のコメントを外してから、
再コンパイル、再インストールする必要があります。
文字列で数値を与える......[][ruby]{
require "bigdecimal"
require "bigdecimal/math"
a = BigMath.E(10)
p c = "0.123456789" * a # => "0.1234567890.123456789"
//}
これは、String#* の内部で、BigDecimal が暗黙的に Integer に変換された結果です。
===[a:internal_structure] 内部構造
BigDecimal内部で......{
#!/usr/local/bin/ruby
require "bigdecimal"
#
# Calculates 3.1415.... (the number of times that a circle's diameter
# will fit around the circle) using J. Machin's formula.
#
def big_pi(sig) # sig: Number of significant figures
exp = -sig
pi = BigDecimal("0")
two = BigDecimal("2")...