XMPP/Jabber的Ruby类库 XMPP4R

码农软件 · 软件分类 · 网络工具包 · 2019-03-03 06:14:44

软件介绍

XMPP4R是一个XMPP/Jabber的Ruby类库。它的目标是提供开发Jabber相关应用程序或者Ruby脚本的完整框架。

安装方法:gem install xmpp4r

示例代码:

  # Send a message to a friend, asking for authorization if necessary:
im = Jabber::Simple.new("user@example.com", "password")
im.deliver("friend@example.com", "Hey there friend!")

# Get received messages and print them out to the console:
im.received_messages { |msg| puts msg.body if msg.type == :chat }

# Send an authorization request to a user:
im.add("friend@example.com")

# Get presence updates from your friends, and print them out to the console:
# (admittedly, this one needs some work)
im.presence_updates { |update|
from = update[0].jid.strip.to_s
status = update[2].status
presence = update[2].show
puts "#{from} went #{presence}: #{status}"
end

# Remove a user from your contact list:
im.remove("unfriendly@example.com")

# See the Jabber::Simple documentation for more information.

本文地址:https://www.codercto.com/soft/d/505.html

算法设计与分析

算法设计与分析

张德富 / 2009-8 / 36.00元

《算法设计与分析》主要取材于算法设计与分析领域的经典内容,并介绍了算法设计的发展趋势。内容主要包括非常经典的算法设计技术,例如递归与分治、动态规划、贪心、回溯、分支限界、图算法,也包括了一些高级的算法设计主题,例如网络流和匹配、启发式搜索、线性规划、数论以及计算几何。在算法分析方面,介绍了概率分析以及最新的分摊分析和实验分析方法。在算法的理论方面,介绍了问题的下界、算法的正确性证明以及NP完全理论......一起来看看 《算法设计与分析》 这本书的介绍吧!

URL 编码/解码
URL 编码/解码

URL 编码/解码

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具