Message from discussion
Short But Unique (#83) : Clarifications
Received: by 10.36.22.10 with SMTP id 10mr6559214nzv;
Sat, 17 Jun 2006 13:16:43 -0700 (PDT)
Return-Path: <ruby-talk-ad...@ruby-lang.org>
Received: from beryllium.ruby-lang.org (beryllium.ruby-lang.org [210.163.138.100])
by mx.googlegroups.com with ESMTP id c18si128084pyc.2006.06.17.13.16.42;
Sat, 17 Jun 2006 13:16:43 -0700 (PDT)
Received-SPF: pass (googlegroups.com: best guess record for domain of ruby-talk-ad...@ruby-lang.org designates 210.163.138.100 as permitted sender)
Received: from beryllium.ruby-lang.org (beryllium.ruby-lang.org [127.0.0.1])
by beryllium.ruby-lang.org (Postfix) with ESMTP id 3996E33E0B;
Sun, 18 Jun 2006 05:16:03 +0900 (JST)
Received: from localhost (beryllium.ruby-lang.org [127.0.0.1])
by beryllium.ruby-lang.org (Postfix) with ESMTP id 6DFDB33E02
for <ruby-t...@ruby-lang.org>; Sun, 18 Jun 2006 05:15:49 +0900 (JST)
Received: from beryllium.ruby-lang.org ([127.0.0.1])
by localhost (beryllium.ruby-lang.org [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id 20343-07 for <ruby-t...@ruby-lang.org>;
Sun, 18 Jun 2006 05:15:49 +0900 (JST)
Received: from smtpout.mac.com (smtpout.mac.com [17.250.248.185])
by beryllium.ruby-lang.org (Postfix) with ESMTP id 3296133DFB
for <ruby-t...@ruby-lang.org>; Sun, 18 Jun 2006 05:15:46 +0900 (JST)
Received: from mac.com (smtpin08-en2 [10.13.10.153])
by smtpout.mac.com (Xserve/8.12.11/smtpout15/MantshX 4.0) with ESMTP id k5HKFjuf012346
for <ruby-t...@ruby-lang.org>; Sat, 17 Jun 2006 13:15:45 -0700 (PDT)
Received: from [192.168.1.104] (pool-71-106-87-197.lsanca.dsl-w.verizon.net [71.106.87.197])
(authenticated bits=0)
by mac.com (Xserve/smtpin08/MantshX 4.0) with ESMTP id k5HKFi82002465
(version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NO);
Sat, 17 Jun 2006 13:15:44 -0700 (PDT)
Delivered-To: ruby-t...@ruby-lang.org
Date: Sun, 18 Jun 2006 05:15:50 +0900
Posted: Sat, 17 Jun 2006 13:15:43 -0700
From: Gautam Dey <g...@mac.com>
Reply-To: ruby-t...@ruby-lang.org
Subject: Re: [QUIZ] Short But Unique (#83) : Clarifications
To: ruby-t...@ruby-lang.org (ruby-talk ML)
Cc: Gautam Dey <g...@mac.com>
Message-Id: <552E2F33-F952-4000-A98D-6393AE98F...@mac.com>
In-Reply-To: <20060616123314.LTHZ14774.centrmmtao04.cox....@localhost.localdomain>
References: <20060616123314.LTHZ14774.centrmmtao04.cox....@localhost.localdomain>
X-ML-Name: ruby-talk
X-Mail-Count: 197860
X-MLServer: fml [fml 4.0.3 release (20011202/4.0.3)]; post only (only members can post)
X-ML-Info: If you have a question, send e-mail with the body
"help" (without quotes) to the address ruby-talk-...@ruby-lang.org;
help=<mailto:ruby-talk-...@ruby-lang.org?body=help>
X-Mailer: Apple Mail (2.750)
X-Original-To: ruby-t...@ruby-lang.org
X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at ruby-lang.org
X-Spam-Checker-Version: SpamAssassin 3.0.6 (2005-12-07) on
beryllium.ruby-lang.org
X-Spam-Level:
X-Spam-Status: No, score=-15.5 required=7.0 tests=BAYES_00,BLARS00,
BLARS_SPAM00,CONTENT_TYPE_PRESENT,QENCPTR1,RCVDFRMLOCALIP,
RCVD_IN_BLARS,RCVD_IN_BLARS_ABUSE,RCVD_IN_BLARS_SPAM,X_MAILER_PRESENT
autolearn=disabled version=3.0.6
Mime-Version: 1.0 (Apple Message framework v750)
Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
Content-Transfer-Encoding: 7bit
Precedence: bulk
Lines: 69
List-Id: ruby-talk.ruby-lang.org
List-Software: fml [fml 4.0.3 release (20011202/4.0.3)]
List-Post: <mailto:ruby-t...@ruby-lang.org>
List-Owner: <mailto:ruby-talk-ad...@ruby-lang.org>
List-Help: <mailto:ruby-talk-...@ruby-lang.org?body=help>
List-Unsubscribe: <mailto:ruby-talk-...@ruby-lang.org?body=unsubscribe>
Two things:
Are the entries in the array always unique?
Or do we have to be able to handle the array such as:
['users_controller', 'users_controller_test', 'account_controller',
'account_controller_test', 'bacon', 'users_controller_test']
Also is the unicode ellipsis counted as one or three characters?
-Gautam Dey
On Jun 16, 2006, at 5:33 AM, Ruby Quiz wrote:
> The three rules of Ruby Quiz:
>
> 1. Please do not post any solutions or spoiler discussion for this
> quiz until
> 48 hours have passed from the time on this message.
>
> 2. Support Ruby Quiz by submitting ideas as often as you can:
>
> http://www.rubyquiz.com/
>
> 3. Enjoy!
>
> Suggestion: A [QUIZ] in the subject of emails about the problem
> helps everyone
> on Ruby Talk follow the discussion. Please reply to the original
> quiz message,
> if you can.
>
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> =-=-=-=-=-=-=
>
> by Ryan Williams
>
> I use Eclipse (with RadRails!) I have a bunch of files open in
> tabs. Once enough
> files are open, Eclipse starts to truncate the names so that
> everything fits.
> It truncates them from the right, which means that pretty soon I'm
> left unable
> to tell which tab is "users_controller.rb" and which is
> "users_controller_test.rb", because they're both truncated to
> "users_control...".
>
> The quiz would be to develop an abbrev-like module that shortens a
> set of
> strings so that they are all within a specified length, and all
> unique. You
> shorten the strings by replacing a sequence of characters with an
> ellipsis
> character [U+2026]. If you want it to be ascii-only, use three
> periods instead,
> but keep in mind that then you can only replace blocks of four or more
> characters.
>
> It might look like this in operation:
>
> ['users_controller', 'users_controller_test',
> 'account_controller', 'account_controller_test',
> 'bacon'].compress(10)
> => ['users_c...', 'use...test', 'account...', 'acc...test', 'bacon']
>
> There's a lot of leeway to vary the algorithm for selecting which
> characters to
> crop, so extra points go to schemes that yield more readable results.
>