25 Jun '12, 4am

“Shades of Gray: Ruby 1.9's String”

James Edward Gray II added about 1 month later: Ruby has another interesting exception when it comes to Encoding incompatibility that may be worth mentioning. You can't typically add String s with incompatible Encoding s as this shows: $ cat incompatible.rb # encoding: UTF-8 utf8 = "一" sjis = "二".encode("Shift_JIS") puts "#{utf8.encoding} + #{sjis.encoding} =" utf8 + sjis $ ruby incompatible.rb UTF-8 + Shift_JIS = incompatible.rb:5:in `<main>': incompatible character encodings: UTF-8 and Shift_JIS (Encoding::CompatibilityError) However, Ruby does keep an eye on String content (mainly for optimization purposes) and when both String s contain only 7-bit ASCII, an exception will be made: $ cat ascii.rb # encoding: UTF-8 utf8 = "abc" sjis = "def".encode("Shift_JIS") print "Given all ASCII data: " if [utf8, sjis].all?(&:ascii_only?) print "#{utf8.encoding} + #{sjis.encoding} = ...

Full article: http://blog.grayproductions.net/articles/ruby_19s_string

Tweets

2hb sold - A:E L James T:Fifty shades of grey, ...

secondhandbooks.com.sg 25 Jun '12, 4am

By Title search trend Hunger Games x127 Twilight x95 Harry Potter x87 Game Thrones x78 Secret x77 Fifty Shades x62 Chicken...

2hb new - A:E L James T:Fifty shades of grey, f...

secondhandbooks.com.sg 25 Jun '12, 6am

By Title search trend Hunger Games x127 Twilight x95 Harry Potter x87 Game Thrones x78 Secret x77 Fifty Shades x62 Chicken...

Shades of Gray: Articles in Higher-Order Ruby:

blog.grayproductions.net 01 Jul '12, 11am

James Edward Gray II joined the Ruby community in 2004 and they just haven't been able to get rid of him since then. James...

Sam Ruby: Ubuntu 12.04 and Ruby 1.9.3

intertwingly.net 24 Jun '12, 10pm

Ubuntu 12.04 and Ruby 1.9.3 Sat 23 Jun 2012 at 22:45 I previously had installed Ubuntu 12.04 on a NetBook, and my overall ...

Ruby Techniques Revealed: Autoload:

rubyinside.com 24 Jun '12, 6pm

Further Googling led me to some interesting discussions about autoload . Back in December 2008, a whole group of Ruby lumi...

Keep cool this summer with a pair of gorgeous n...

coach.com 25 Jun '12, 9pm

Glamorously oversized, this playful, colorful design features Signature Cs inside the arms and the \u201Cjumbled\u201D Coa...

Shades of Gray: Lists and Sets in Redis:

blog.grayproductions.net 24 Jun '12, 12am

#!/usr/bin/env ruby -wKU require "rubygems" require "redis" CLEAR = `clear` # create an article to comment on db = Redis.n...

to_str method in ruby

rubyflow.com 27 Jun '12, 2am

to_str method in ruby Posted by bigbinary on June 27, 2012 — 0 comments A blog on to_str method in ruby . Comments “ ” Pos...

Satish Talim: Ruby Study Notes - Best Ruby Guid...

rubylearning.com 27 Jun '12, 12am

is a senior software consultant based in Pune, India with over 30+ years of I.T. experience. His experience lies in develo...

IDN ccTLD Request From Mongolia Successfully Pa...

icann.org 25 Jun '12, 2am

ICANN is pleased to announce the successful completion of String Evaluation on proposed IDN ccTLD string for Mongolia. Det...

Ruby 程序设计语言官方网站:

ruby-lang.org 24 Jun '12, 2am

一直以来,Ruby 在中国都没有一个靠谱的社区,如今,Ruby China Group 出现了,Ruby China Group 是一个非营利组织,它旨在为中国的 Ruby 和 Rails 爱好者提供一个自由,开放的交流平台。 如果你: 爱 R...

Estimated Traffic Net Worth $899.

rubyrow.net 28 Jun '12, 12pm

"It has been a pleasure working with Ruby Row to advertise RailsKits.com. Of course I appreciate how having a focused adve...

Best Ruby Guide, Ruby Tutorial:

rubylearning.com 01 Jul '12, 12pm

# p014constructs.rb # In Ruby, nil and false evaluate to false, # everything else (including true, 0) means true # nil is ...

More from Ruby Under a Microscope

rubyflow.com 29 Jun '12, 4pm

More from Ruby Under a Microscope Posted by patshaughnessy on June 29, 2012 — 0 comments This is an eBook I’m writing this...

#agileroots @coreyhaines #coderetreat a ruby implementation of gol from #ryanbiggs cool to watch

#agileroots @coreyhaines #coderetreat a ruby im...

rubyinside.com 25 Jun '12, 4am

Screencast: Coding Conway’s Game of Life in Ruby the TDD Way with RSpec By Peter Cooper / November 2, 2011 Recently, there...