Lost in Translation


Today I read 2 Corinthians 7:10 (King James Version):

For godly sorrow worketh repentance to salvation not to be repented of: but the sorrow of the world worketh death.

Makes sense, except for the “not to be repented of” part. “repentance to salvation not to be repented of”? Do we repent or don’t we?

The Svenska 1917 version is helpful. Here the first “repentance” is translated as bedrövelse, which means “distress, grief, sorrow”,1 and the second “repented” is ångrar: “regret”.2

This is the same idea as expressed in the New International Version:

Godly sorrow brings repentance that leads to salvation and leaves no regret, but worldly sorrow brings death.

The English Standard Version and New King James Versions seem to agree.

The Levande Bibeln, a newer translation completed in 2000, is quite verbose; here’s my translation of their translation:

God sometimes uses sorrow in our lives to help us to turn from sin and seek eternal life. Therefore, we never need complain that he sends them. But the sorrow which a man who isn’t Christian experiences is of human sort, and that leads to death.

Apparently “[t]his translation uses an informal language style and applies a meaning-based translation philosophy”.3

The Wycliffe New Testament translation doesn’t seem to fit. Where did they get “health” from?

For the sorrow that is after God, worketh penance into steadfast health; but sorrow of the world worketh death.

The 21st Century King James Version is perhaps the worst of all, as misleading scripture is worse than just confusing scripture.

For godly sorrow is not to be repented of, but worketh repentance unto salvation; but the sorrow of the world worketh death.

No wonder people are confused. Thank goodness for continuing revelation…



Working with Unicode in Ruby


I hate it when useful stuff on the internet disappears. Fortunately I was able to retrieve this from the Google Cache. Originally posted at www.leftbee.net/articles/2006/08/03/working-with-unicode-in-ruby/.

Working with Unicode in Ruby

Note: This guide is UTF-8 oriented and does not cover any other unicode variants.

I’m presenting this very brief guide to help ruby users deal with unicode, more specifically with UTF-8.

First of all you need to setup Ruby to work with UTF-8 strings:

$KCODE = 'u'
require 'jcode'

The first line indicates the encoding the ruby interpreter will use — in our case we use ‘u’ which stands for UTF-8.

The second line requires the ruby library to deal with multibyte strings such as UTF-8 ones.

This library (jcode) extends String with some new methods such as:

  • jcount
  • jlength
  • jsize (alias for jlength)

Let’s try counting the ocurrences of “ü” in Ouvertüre using count and jcount:

irb(main):005:0> "Ouvertüre".count("ü")

=> 2
irb(main):006:0> "Ouvertüre".jcount("ü")

=> 1

As you can see, jcount gives a reliable result whereas count returns 2.

This library also overrides some String methods:

  • each_char
  • chop, chop!
  • delete, delete!
  • squeeze, squeeze!
  • succ, succ!
  • tr, tr!
  • trs, trs!

And adds a new one:

  • mbchar?

Wondering what this one does?

Let’s find out:

irb(main):007:0> "Ouvertüre".mbchar?

=> 6
irb(main):008:0> "Schön".mbchar?
=> 3

Uh huh! Seems to be indicating where the first multibyte char is: 7th place for the ü in Ouvertüre and 4th place for ö in Schön, which looks right if you consider that the index is zero based.

What about using upcase and downcase with UTF-8 strings?
Let’s try:

irb(main):009:0> "Ouvertüre".upcase

=> "OUVERTüRE"

Ooops, doesn’t look right!

Time to present a new friend:

It’s a Ruby gem and it’s called… tzashaaam: unicode. Easy eh?
Ok, so let’s require it and see what happens.

(of course you will need to install the gem first, use gem install unicode)

irb(main):010:0> require 'rubygems'

=> true
irb(main):011:0> require 'unicode'

=> true

(Make sure jcode has been previously loaded, otherwise it will refuse to load)

Now we have a few more methods to use:

  • Unicode::downcase
  • Unicode::upcase
  • Unicode::normalize

Let’s see them working:

irb(main):012:0> Unicode.upcase "Ouvertüre"
=> "OUVERTÜRE"

Mmm, that’s better!

irb(main):013:0> Unicode.downcase "OUVERTÜRE"

=> "ouvertüre"

Great!

But… what’s the normalize method for?

Let’s say Unicode normalization is something out of the scope of this brief guide.
You can read all about it at unicode.org (you are asking for a severe headache though!)

Well, that’s all for now!

Posted by Ruben on Thursday, August 03, 2006

Copyright © 2006-2007 Ruben Nine. All Rights Reserved.
This site is powered by Radiant CMS. (His site, not mine :)



Desklets, Screenlets, Widgets, and Compiz


Widgets (or desklets, or screenlets, or whatever) are small programs which run embedded on your desktop. Compiz has a plugin which creates a separate layer for widgets, flying them in and out with the press of a key, similar to the dashboard on Mac OS.

In order to make use of the Widget Layer, you first need a widget engine. Once you have your widgets running normally outside of Compiz, you configure the plugin to hide the widgets, presenting them in the Widget Layer when you hit F9.

Widget Engines

adesklets
Homepage: http://adesklets.sourceforge.net/
HowTo: https://help.ubuntu.com/community/AdeskletsHowto

gDesklets
Homepage: http://www.gdesklets.de/
Engine Installation: sudo apt-get install gdesklets. Most of the desklets included in the gdesklets-data package are broken; you’ll want to download them directly from the gdesklets site.
Widget Language: Python
To start the engine run gdesklets start.
To start a widget double-click the widget in the GUI you get from gdesklets shell.
Although the man page claims beta support for transparency, it didn’t work for me at all. I added a simple clock widget and it ate a constant 5% of my CPU :(.

Glossitope
Homepage: http://www.glossitope.org/site/
Widget Language: Java
Note: Not very many widgets.

Screenlets
Homepage: http://screenlets.org/
Widget Installation: untar and run make install
Widget Language: Python
To start the engine run screenlets-daemon.py (probably under /usr/local/share/screenlets-manager/) or enable the screenlet in the GUI. (I’m not sure if this is even necessary.)
To start a widget just run it directly: /path/to/my_widget.py (probably under /usr/local/share/screenlets/ or ~/.screenlets/). To add each widget to the widget layer right-click on it and select “Window” -> “Widget”. The widget should disappear and reappear in your widget layer.
These widget support true transparency!

Other widget engines

Find more widgets at


powered by WordPress     themed by Mukkamu     presented by ideaharbor.org     everything else by steve hulet