require "wx" include Wx # a new class which derives from the Wx::App class class HelloWorl…
require 'socket' # Get sockets from stdlib server = TCPServer.open(2000) # Socket to liste…
require 'socket' host = 'localhost' port = 1234 s = UDPSocket.new s.bind(nil, port) s.send…
#!/usr/bin/env ruby # coding: utf-8 # vim: set sw=2 sts=2 et nowrap fenc=utf-8 : require '…
require 'yaml' class Special def initialize(valuable, volatile, precious) @valuable = valu…
require 'uri' Net::HTTP.get(URI.parse("http://www.oschina.net")) response = Net::HTTP.get_…
print "Enter an amount: " amount = gets.to_f print "Convert it from what(inches, feet, mil…
#PennyBoki @ </dream.in.code> puts "Please select " puts 'A for Celsius to Fahrenhei…
# return 4 urls, with and without trailing slash, with and without www # useful for matchi…
require 'socket' s = UDPSocket.new s.bind(nil, 1234) 5.times do text, sender = s.recvfrom(…
data = [’1′, ‘2′, ‘3′] s = ‘ ‘ data.each { |x| s << x << ‘ and a ‘ } s # =>…
require 'drb' class TestServer def add(*args) args.inject {|n,v| n + v} end end server = T…