Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

BOFH excuse #68: only available on a need to know basis


comp / comp.lang.python / RE: From JoyceUlysses.txt -- words occurring exactly once

SubjectAuthor
* From JoyceUlysses.txt -- words occurring exactly onceHenHanna
+* Re: From JoyceUlysses.txt -- words occurring exactly oncedn
|`* Re: From JoyceUlysses.txt -- words occurring exactly onceHenHanna
| +- Re: From JoyceUlysses.txt -- words occurring exactly oncePeter J. Holzer
| +- Re: From JoyceUlysses.txt -- words occurring exactly onceThomas Passin
| +- Re: From JoyceUlysses.txt -- words occurring exactly oncedn
| +- Re: From JoyceUlysses.txt -- words occurring exactly onceGrant Edwards
| +- Re: From JoyceUlysses.txt -- words occurring exactly onceThomas Passin
| +- Re: From JoyceUlysses.txt -- words occurring exactly onceMats Wichmann
| +* Re: From JoyceUlysses.txt -- words occurring exactly onceLarry Martell
| |`- Re: From JoyceUlysses.txt -- words occurring exactly onceStefan Ram
| +- Re: From JoyceUlysses.txt -- words occurring exactly onceThomas Passin
| +- RE: From JoyceUlysses.txt -- words occurring exactly once<avi.e.gross
| +- Re: From JoyceUlysses.txt -- words occurring exactly onceThomas Passin
| +- RE: From JoyceUlysses.txt -- words occurring exactly once<avi.e.gross
| `- Re: From JoyceUlysses.txt -- words occurring exactly onceGrant Edwards
+* Re: From JoyceUlysses.txt -- words occurring exactly oncePieter van Oostrum
|`- Re: From JoyceUlysses.txt -- words occurring exactly onceGrant Edwards
+- Re: From JoyceUlysses.txt -- words occurring exactly oncedieter.maurer
+- Re: From JoyceUlysses.txt -- words occurring exactly onceThomas Passin
`* Re: From JoyceUlysses.txt -- words occurring exactly onceMats Wichmann
 `* Re: From JoyceUlysses.txt -- words occurring exactly onceEdward Teach
  +* Re: From JoyceUlysses.txt -- words occurring exactly onceGrant Edwards
  |`* Re: From JoyceUlysses.txt -- words occurring exactly onceEdward Teach
  | +- Re: From JoyceUlysses.txt -- words occurring exactly onceGrant Edwards
  | +- RE: From JoyceUlysses.txt -- words occurring exactly once<avi.e.gross
  | `- Re: From JoyceUlysses.txt -- words occurring exactly onceChris Angelico
  `- Re: From JoyceUlysses.txt -- words occurring exactly oncedieter.maurer

Pages:12
Subject: Re: From JoyceUlysses.txt -- words occurring exactly once
From: Thomas Passin
Newsgroups: comp.lang.python
Date: Sat, 8 Jun 2024 19:41 UTC
References: 1 2 3 4 5 6 7 8 9 10 11
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!not-for-mail
From: list1@tompassin.net (Thomas Passin)
Newsgroups: comp.lang.python
Subject: Re: From JoyceUlysses.txt -- words occurring exactly once
Date: Sat, 8 Jun 2024 15:41:03 -0400
Lines: 163
Message-ID: <mailman.101.1717877910.2909.python-list@python.org>
References: <v3am2l$1qf6m$3@dont-email.me>
<aef0bc5c-b0b6-4d7d-af05-cc22c165f327@DancesWithMice.info>
<mailman.74.1717103931.2909.python-list@python.org>
<v3bcgu$229eq$1@dont-email.me>
<3dedbc3b-7db0-4a39-863f-56324d434b12@DancesWithMice.info>
<8409fd89-8b42-43c4-8511-704d57b3a4be@tompassin.net>
<2f37a78b-0757-4e1a-860a-9fe3f86200cf@wichmann.us>
<CACwCsY5Ga8Lq8-gPZWSsEWbgmP+VKsF7DjLpN_GFbBEgjuPKBw@mail.gmail.com>
<f3a15c33-8fd2-44f7-a9ab-442a663af7be@tompassin.net>
<005b01dab9d4$350d7290$9f2857b0$@gmail.com>
<b9cf4655-71d6-4e1d-b65b-3d8e74d72057@tompassin.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64
X-Trace: news.uni-berlin.de dOWfj23Ay2cvWf5RVGeLaAk5gFNjafPqLyHlrZob++eA==
Cancel-Lock: sha1:dlISM7XhIrva7NrCR7hxXR7z7ZY= sha256:MdcOHb58D4J5tUrqYgKDNBIR5NR1KVDYfWsDgkr/Zjw=
Return-Path: <list1@tompassin.net>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=tompassin.net header.i=@tompassin.net header.b=TZ/Y0Xh1;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.001
X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'projects,': 0.03; 'knows':
0.04; 'fairly': 0.05; 'random': 0.05; 'programmer': 0.07;
'thing.': 0.07; 'aligned': 0.09; 'approaches': 0.09; 'email
addr:python.org>': 0.09; 'enough.': 0.09; 'graph': 0.09; 'junior':
0.09; 'plots': 0.09; 'situation,': 0.09; 'something,': 0.09;
'thinks': 0.09; 'trivial': 0.09; 'user.': 0.09; '2024': 0.16;
'>>>>': 0.16; 'all)': 0.16; 'alluding': 0.16; 'along.': 0.16;
'arbitrary': 0.16; 'arguments': 0.16; 'bugs': 0.16; 'column':
0.16; 'columns': 0.16; 'dataset': 0.16; 'datasets': 0.16;
'diagram': 0.16; 'doable': 0.16; 'extensions': 0.16; 'extracting':
0.16; 'generalized': 0.16; 'joy': 0.16; 'labels': 0.16; 'layers':
0.16; 'mats': 0.16; 'overlay': 0.16; 'plot.': 0.16;
'received:10.0.0': 0.16; 'received:64.90': 0.16;
'received:64.90.62': 0.16; 'received:64.90.62.162': 0.16;
'received:dreamhost.com': 0.16; 'reuse': 0.16; 'rewrite': 0.16;
'similar.': 0.16; 'size.': 0.16; 'sorry!': 0.16; 'subject: -- ':
0.16; 'subject:words': 0.16; 'times,': 0.16; 'understood.': 0.16;
'wichmann': 0.16; 'wrote:': 0.16; 'problem': 0.16; 'python': 0.16;
'values': 0.17; 'code.': 0.17; "aren't": 0.19; 'it?': 0.19; 'pm,':
0.19; 'to:addr:python-list': 0.20; 'all,': 0.20; "i've": 0.22;
'languages': 0.22; 'creates': 0.22; 'sat,': 0.22; "what's": 0.22;
'code': 0.23; 'feedback': 0.23; 'lines': 0.23; 'idea': 0.24;
'anything': 0.25; 'skip:- 10': 0.25; 'actual': 0.25; 'cannot':
0.25; 'seems': 0.26; 'tried': 0.26; 'available,': 0.26; 'jun':
0.26; 'object': 0.26; "isn't": 0.27; 'else': 0.27; 'bit': 0.27;
'function': 0.27; 'done': 0.28; '>>>': 0.28; 'fact': 0.28;
'purpose': 0.28; 'request.': 0.28; 'series': 0.28; 'ideas': 0.28;
'suggest': 0.28; 'recently': 0.29; 'asked': 0.29; 'header:User-
Agent:1': 0.30; 'below': 0.69; 'interview': 0.70; 'person.': 0.70;
'truly': 0.70; 'trust': 0.71; 'longer': 0.71; 'future': 0.72;
'deal': 0.73; 'june': 0.73; 'easy': 0.74; 'chain': 0.76;
'documented': 0.76; 'implemented': 0.76; 'limits': 0.76;
'supposed': 0.76; 'out,': 0.78; 'sent:': 0.78; 'quickly': 0.80;
'spent': 0.81; 'client': 0.82; 'more.': 0.82; 'known': 0.84;
'points': 0.84; 'adjusted': 0.84; 'adjusting': 0.84; 'axis': 0.84;
'coded': 0.84; 'danger': 0.84; 'etc.,': 0.84; 'experiments': 0.84;
'fortunately,': 0.84; 'from.': 0.84; 'good,': 0.84; 'lines,':
0.84; 'localized': 0.84; 'measurement': 0.84; 'measurements':
0.84; 'occurring': 0.84; 'periods': 0.84; 'phases': 0.84; 'pie':
0.84; 'saturday,': 0.84; 'sizes': 0.84; 'want.': 0.84; 'wiser':
0.84; 'anticipated': 0.91; 'chart': 0.91; 'flexible': 0.91;
'subject:From': 0.91; 'subject:once': 0.91; 'goals': 0.96
X-Sender-Id: dreamhost|x-authsender|tpassin@tompassin.net
ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1717875664; a=rsa-sha256;
cv=none;
b=nFRn3NkQv9P8/yiqDI7sxclMaWXbHzk1YMUCcTJI0rcrll0K0YjgmItIo11863KhtJ8hpf
dhJ+pOkALtHmlvGdTa9O+Nwou/r2ssFdtc8lmfdElEE8THcAS4xke6NmgePZPg3IqtgyM2
aKDcXCA3quxurS+oKFulmaB2HD31W4nj5+2LRT85sGbHDcQmCGzQEUK33XZKPHxW0SJjfw
ksldTKCK3aGPCj6lgh8xy4F3p7kue4SRgeD13ZZ3lpbarJdxU1hruXrz99u162KDXQAfz4
O1hMEdwC+Btg5f1bND0vv6t1iYxnnnmx0WQJc2WTKefNeEIKfApobRjlMhJRHQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed;
d=mailchannels.net; s=arc-2022; t=1717875664;
h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
to:to:cc:mime-version:mime-version:content-type:content-type:
content-transfer-encoding:content-transfer-encoding:
in-reply-to:in-reply-to:references:references:dkim-signature;
bh=/d8mHSZDckPKHJ9vapdwPjT8H6aHVBCK9u7JaZ2N0gQ=;
b=ttEh+KcGnjFxv9r4dbKErcc07Z41PKjdGrnXVaBa0prkoWoE7SqpVdvq2m3cLOfbXIFwYA
jvPpcFSNYH80HDxKi4mexPkJt9y+w4aBCDKhy6faz2cf5APZmV3otvv6/fuWP6QWuHJGiq
9yctSW5rhW3LgKk7X+9rUCHum5nGWXmOCXo+Szln0T/rtsI2lNTb2VfoRdDQ/JllNeX8h7
GWylsBA9XuE1BpugxpqXSGCpon29XJAufNXdPU5GqqyR50CD8/7MeLFF19chVNmUNgbGZz
jxwkOgcK8+FyX9cxwD8C51tljnzBmKGOO+ja5czuth6Cv2ITBbv907RbvdxZ2Q==
ARC-Authentication-Results: i=1; rspamd-7f76976655-bzhs4;
auth=pass smtp.auth=dreamhost smtp.mailfrom=list1@tompassin.net
X-Sender-Id: dreamhost|x-authsender|tpassin@tompassin.net
X-MC-Relay: Neutral
X-MailChannels-SenderId: dreamhost|x-authsender|tpassin@tompassin.net
X-MailChannels-Auth-Id: dreamhost
X-Imminent-Well-Made: 11f220d60f1a179f_1717875665001_3530176761
X-MC-Loop-Signature: 1717875665001:3105899128
X-MC-Ingress-Time: 1717875665001
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tompassin.net;
s=dreamhost; t=1717875664;
bh=/d8mHSZDckPKHJ9vapdwPjT8H6aHVBCK9u7JaZ2N0gQ=;
h=Date:Subject:To:From:Content-Type:Content-Transfer-Encoding;
b=TZ/Y0Xh18g0F/TCcryXo8zuT0NQxlGgIGVS+CS+4wAtYjM31ZIJFVvKVFi34RPA+C
4ZwlxrhGV8aZluvD8BbJGJNgheGukdoAZ+7zo1sN72HhkQDYMvJOd0Fpz6jY3J5iRx
6qrFnBtLW5LdyOwQUk4Km/7AFDWgQ0U9KbUkEHCHcAJloJHa1XEtBkIFAG1ilr4k2W
ugzd/i2bL9IyIRwidrlj7D/ZoGQc+cOMAmqauR0Q0CRhLgUUz4e7BD5CyLhh3UWq5P
T1SVx67WtW6NnroiLIsYudrg8JFuIgx0tpbVG7S9uTPa/hoGE8ojiPgQLPU3wXqA8M
duDuFR2FaCgIw==
User-Agent: Mozilla Thunderbird
Content-Language: en-US
In-Reply-To: <005b01dab9d4$350d7290$9f2857b0$@gmail.com>
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <b9cf4655-71d6-4e1d-b65b-3d8e74d72057@tompassin.net>
X-Mailman-Original-References: <v3am2l$1qf6m$3@dont-email.me>
<aef0bc5c-b0b6-4d7d-af05-cc22c165f327@DancesWithMice.info>
<mailman.74.1717103931.2909.python-list@python.org>
<v3bcgu$229eq$1@dont-email.me>
<3dedbc3b-7db0-4a39-863f-56324d434b12@DancesWithMice.info>
<8409fd89-8b42-43c4-8511-704d57b3a4be@tompassin.net>
<2f37a78b-0757-4e1a-860a-9fe3f86200cf@wichmann.us>
<CACwCsY5Ga8Lq8-gPZWSsEWbgmP+VKsF7DjLpN_GFbBEgjuPKBw@mail.gmail.com>
<f3a15c33-8fd2-44f7-a9ab-442a663af7be@tompassin.net>
<005b01dab9d4$350d7290$9f2857b0$@gmail.com>
View all headers

On 6/8/2024 2:46 PM, avi.e.gross@gmail.com wrote:
> Agreed, Thomas.
>
> As someone who has spent lots of time writing code OR requirements of various levels or having to deal with the bugs afterwards, there can be a huge disconnect between the people trying to decide what to do and the people having to do it. It is not necessarily easy to come back later and ask for changes that wewre not anticipated in the design or implementation.
And typical contract vehicles aren't often flexible to allow for this
kind of thing. I've always tried to persuade my management to allow
built-in phases where re-evaluation can take place based on what's been
learned. To have a hope of that working, though, there needs to be a lot
of trust between client and development folks. Can be hard to come by.
> I recently wrote a program where the original specifications seemed reasonable. In one part, I was asked to make a graph with some random number (or all) of the data shown as a series of connected line segments showing values for the same entity at different measurement periods and then superimpose the mean for all the original data, not just the subsample shown. This needed to be done on multiple subsamples of the original/calculated data so I made it into a function.
>
> One of the datasets contained a column that was either A or B and the function was called multiple times to show what a random sample of A+B, just A and just B graphed like along with the mean of the specific data it was drawn from. But then, I got an innocuously simple request.
>
> Could we graph A+B and overlay not only the means for A+B as was now done, but also the mean for A and the mean for B. Ideally, this would mean three bolder jaged lines superimposed above the plot and seemed simple enough.
>
> But was it? To graph the means in the first place, I made a more complex data structure needed so when graphed, it aligned well with what was below it. But that was hard coded in my function, but in one implementation, I now needed it three times. Extracting it into a new function was not trivial as it depended initially on other things within the body of the function. But, it was doable and might have been done that way had I known such a need might arise. It often is like that when there seems no need to write a function for just one use. The main function now needed to be modified to allow optionally adding one or two more datasets and if available, call the new function on each and add layers to the graph with the additional means (dashed and dotted) if they are called while otherwise, the function worked as before.
I feel your pain. In the generalized X-Y graphing program I've evolved
over several generations, I have graphing methods that can plot points
and curves, optionally overlaying them. Any function that wants to plot
something has to generate a dataset object of the type that the plotter
knows how to plot. No exceptions. Nothing else ever plots to the
screen. It's simple and works very well ... but I only designed it to
have axis labels and the title of the plot. They are all three
interactive, editable by the user. That's good, but for anything else
it's hack time. Witness lines, legends, point labels, etc., etc. don't
have a natural home.
> But did I do it right? Well, if next time I am asked to have the data extended to have more measurements in more columns at more times, I might have to rewrite quite a bit of the code. My localized change allowed one or two additional means to be plotted. Adding an arbitrary number takes a different approach and, frankly, there are limits on how many kinds of 'line" segments can be used to differentiate among them.
This is the kind of situation where it needs to be implemented three
times before it gets good. One always thinks that the second time
around will work well because all the lessons were learned the first
time around. But no, it's not the second but the third implementation
that can start to be really good.
> Enough of the example except to make a point. In some projects, it is not enough to tell a programmer what you want NOW. You may get what you want fairly quickly but if you have ideas of possible extensions or future upgrades, it would be wiser to make clear some of the goals so the programmer creates an implementation that can be more easily adjusted to do more. Such code can take longer and be more complex so it may not pay off immediately.
>
> But, having said that, plenty of software may benefit from looking at what is happening and adjusting on the fly. Clearly my client cannot know what feedback they may get when showing an actual result to others who then suggest changes or enhancements. The results may not be anticipated so well in advance and especially not when the client has no idea what is doable and so on.
>
> A related example was a request for how to modify a sort of Venn Diagram chart to change the font size. Why? Because some of the labels were long and the relative sizes of the pie slices were not known till an analysis of the data produced the appropriate numbers and ratios. This was a case where the documentation of the function used by them did not suggest how to do many things as it called a function that called others to quite some depth. A few simple experiments and some guesses and exploration showed me ways to pass arguments along that were not documented but that were passed properly down the chain and I could now change the text size and quite a few other things. But I asked myself if this was really the right solution the client needed. I then made a guess on how I could get the long text wrapped into multiple lines that fit into the sections of the Venn Diagram without shrinking the text at all, or as much. The client had not considered that as an option, but it was better for their display than required. But until people see such output, unless they have lots of experience, it cannot be expected they can tell you up-front what they want.
>
> One danger of languages like Python is that often people get the code you supply and modify it themselves or reuse it on some project they consider similar. That can be a good thing but often a mess as you wrote the code to do things in a specific way for a specific purpose ...
>
>
> -----Original Message-----
> From: Python-list <python-list-bounces+avi.e.gross=gmail.com@python.org> On Behalf Of Thomas Passin via Python-list
> Sent: Saturday, June 8, 2024 1:10 PM
> To: python-list@python.org
> Subject: Re: From JoyceUlysses.txt -- words occurring exactly once
>
> On 6/8/2024 11:54 AM, Larry Martell via Python-list wrote:
>> On Sat, Jun 8, 2024 at 10:39 AM Mats Wichmann via Python-list <
>> python-list@python.org> wrote:
>>
>>> On 6/5/24 05:10, Thomas Passin via Python-list wrote:
>>>
>>>> Of course, we see this lack of clarity all the time in questions to the
>>>> list. I often wonder how these askers can possibly come up with
>>>> acceptable code if they don't realize they don't truly know what it's
>>>> supposed to do.
>>>
>>> Fortunately, having to explain to someone else why something is giving
>>> you trouble can help shed light on the fact the problem statement isn't
>>> clear, or isn't clearly understood. Sometimes (sadly, many times it
>>> doesn't).
>>
>>
>> The original question struck me as homework or an interview question for a
>> junior position. But having no clear requirements or specifications is good
>> training for the real world where that is often the case. When you question
>> that, you are told to just do something, and then you’re told it’s not what
>> is wanted. That frustrates people but it’s often part of the process.
>> People need to see something to help them know what they really want.
>
> At the extremes, there are two kinds of approaches you are alluding to.
> One is what I learned to call "rock management": "Bring me a rock ...
> no, that's not the right one, bring me another ... no that's not what
> I'm looking for, bring me another...". If this is your situation, so,
> so sorry!
>
> At the other end, there is a mutual evolution of the requirements
> because you and your client could not have known what they should be
> until you have spent effort and time feeling your way along. With the
> right client and management, this kind of project can be a joy to work
> on. I've been lucky enough to have worked on several projects of this kind.
>
> In truth, there always are requirements. Often (usually?) they are not
> thought out, not consistent, not articulated clearly, and not
> communicated well. They may live only in the mind of one person.
>

Subject: RE: From JoyceUlysses.txt -- words occurring exactly once
From: <avi.e.gross@gmail.com>
Newsgroups: comp.lang.python
Date: Sat, 8 Jun 2024 22:07 UTC
References: 1 2 3 4 5 6 7 8 9
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!not-for-mail
From: <avi.e.gross@gmail.com>
Newsgroups: comp.lang.python
Subject: RE: From JoyceUlysses.txt -- words occurring exactly once
Date: Sat, 8 Jun 2024 18:07:07 -0400
Lines: 88
Message-ID: <mailman.102.1717884431.2909.python-list@python.org>
References: <v3am2l$1qf6m$3@dont-email.me>
<aef0bc5c-b0b6-4d7d-af05-cc22c165f327@DancesWithMice.info>
<mailman.74.1717103931.2909.python-list@python.org>
<v3bcgu$229eq$1@dont-email.me>
<3dedbc3b-7db0-4a39-863f-56324d434b12@DancesWithMice.info>
<8409fd89-8b42-43c4-8511-704d57b3a4be@tompassin.net>
<2f37a78b-0757-4e1a-860a-9fe3f86200cf@wichmann.us>
<CACwCsY5Ga8Lq8-gPZWSsEWbgmP+VKsF7DjLpN_GFbBEgjuPKBw@mail.gmail.com>
<007201dab9f0$342b8d50$9c82a7f0$@gmail.com>
Mime-Version: 1.0
Content-Type: text/plain;
charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Trace: news.uni-berlin.de e68jjQDzhIooavb6X69gpg0Cc/yw0WQYoyVhGdNOULNw==
Cancel-Lock: sha1:T6H3DPnx4G00k2UjMBbjDMpNAak= sha256:f2xlrslOUJpeIGxqguwj/HfxUrjOqfBu0y38ku/pIFY=
Return-Path: <avi.e.gross@gmail.com>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=gmail.com header.i=@gmail.com header.b=i1A3h0Sg;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.013
X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'away.': 0.05; 'fairly':
0.05; 'programmer': 0.07; 'suggestion': 0.07; 'up?': 0.07;
'cc:addr:python-list': 0.09; 'characters,': 0.09; 'email
addr:python.org>': 0.09; 'junior': 0.09; 'received:108': 0.09;
'slide': 0.09; 'solution,': 0.09; 'something,': 0.09; 'text.':
0.09; 'thinks': 0.09; 'cc:no real name:2**0': 0.14; 'url:mailman':
0.15; 'problem.': 0.15; '2024': 0.16; 'applies': 0.16;
'dictionary.': 0.16; 'examine': 0.16; 'hash': 0.16; 'mats': 0.16;
'mentioned,': 0.16; 'part.': 0.16; 'specify': 0.16; 'subject: --
': 0.16; 'subject:words': 0.16; 'understood.': 0.16; 'wichmann':
0.16; 'words.': 0.16; 'wrote:': 0.16; 'problem': 0.16; 'python':
0.16; 'message-id:@gmail.com': 0.18; 'cc:addr:python.org': 0.20;
'language': 0.21; 'languages': 0.22; 'maybe': 0.22; 'problem,':
0.22; 'sat,': 0.22; 'way.': 0.22; 'code': 0.23; 'lines': 0.23;
'skip:- 10': 0.25; 'url-ip:188.166.95.178/32': 0.25; 'url-
ip:188.166.95/24': 0.25; 'url:listinfo': 0.25; 'cc:2**0': 0.25;
'programming': 0.25; 'url-ip:188.166/16': 0.25; 'jun': 0.26;
"isn't": 0.27; 'else': 0.27; 'local': 0.27; 'done': 0.28; 'fact':
0.28; 'output': 0.28; 'approach': 0.31; 'url-ip:188/8': 0.31;
'program': 0.31; 'think': 0.32; 'question': 0.32; 'concept': 0.32;
'do.': 0.32; 'manipulate': 0.32; 'python-list': 0.32; 'rapidly':
0.32; 'realize': 0.32; 'but': 0.32; 'someone': 0.34; 'able': 0.34;
'same': 0.34; 'header:In-Reply-To:1': 0.34; 'received:google.com':
0.34; 'words': 0.35; 'from:addr:gmail.com': 0.35; 'count': 0.36;
'functions': 0.36; 'possibly': 0.36; 'people': 0.36; 'missing':
0.37; 'presented': 0.37; 'really': 0.37; 'using': 0.37; "it's":
0.37; 'way': 0.38; 'could': 0.38; 'means': 0.38; 'read': 0.38;
'text': 0.39; 'this,': 0.39; 'use': 0.39; 'rest': 0.39; 'case.':
0.40; 'exact': 0.40; 'explain': 0.40; 'reports': 0.40; 'learn':
0.40; 'something': 0.40; 'want': 0.40; 'try': 0.40; 'should':
0.40; 'lack': 0.60; 'provide': 0.60; 'best': 0.61; 'method': 0.61;
'above': 0.62; 'from:': 0.62; 'to:': 0.62; 'reasonable': 0.62;
'showing': 0.62; 'come': 0.62; 'once': 0.63; 'skip:m 20': 0.63;
'hear': 0.64; 'clear': 0.64; 'definition': 0.64; 're:': 0.64;
'parts': 0.65; 'process.': 0.65; 'let': 0.66; 'that,': 0.67;
'right': 0.68; 'exactly': 0.68; 'matter': 0.68; 'acceptable':
0.69; 'cc:': 0.69; 'clarity': 0.69; 'remaining': 0.69; 'shed':
0.69; 'times': 0.69; 'interview': 0.70; 'truly': 0.70; 'waiting':
0.73; 'june': 0.73; 'supposed': 0.76; 'sent:': 0.78; 'effect,':
0.84; 'fortunately,': 0.84; 'occurring': 0.84; 'saturday,': 0.84;
'say,': 0.84; 'want.': 0.84; 'subject:From': 0.91; 'subject:once':
0.91
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20230601; t=1717884429; x=1718489229; darn=python.org;
h=content-language:thread-index:content-transfer-encoding
:mime-version:message-id:date:subject:in-reply-to:references:cc:to
:from:from:to:cc:subject:date:message-id:reply-to;
bh=oqUnY3pqsDufaXLEPhD7ZyGuYRMXK0BdZmENIkEsSKs=;
b=i1A3h0Sgwe64mfjiUBOL4n1ZUOaF1V7H3LOYvcV/WozEJHvoagJFvVn9eH5Re0Tk3G
ybhwHigS2uLHo6RdLcx1iIkZQDcumVc5thAwsIxMbhKCg62Oin0CJ0l+YV0pKXNLsikA
TR8ICD4faqn9o4ZbNRtXywrR+Z+C0PCizNdKf5DTIf6VEDgNzaaQ3o/PnmBEDtsHWRva
Ic8Lz+I9VsH2iEMRpRgTvf3iWS2p4idsy6PlNJ7K/X7bnAdGmzDmWg3+3Pj8xOWlL+2q
p1IOdANp4ECRjRlIQO+iI9jZUUtjjqUvDozaRKz50h3y1P833D0Xq83nzkl4UifvhCxI
ILqw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1717884429; x=1718489229;
h=content-language:thread-index:content-transfer-encoding
:mime-version:message-id:date:subject:in-reply-to:references:cc:to
:from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
bh=oqUnY3pqsDufaXLEPhD7ZyGuYRMXK0BdZmENIkEsSKs=;
b=TG+BrUd2Mw7wAR/jDqbjkHiqC0hfasJigL/62+T5AvI+LfPYg+/fBPPL4pNMLi2+t6
S3hQjJFlYAv5MKRKopLYJMT7O3Cp3Qu1qxAKhb6+s6qLMBmcjK9jxYKd3Aljz6RAg6TS
LeClXCdES7QnjUB220QwSKpzbipG2gcLqMZzbYCkrqLAdUd0REB/3ANG0h+BgAQF0FWE
cIeSnxQ/bTBZxp/oyKMV2xwyQgfnJqXnm0tBqn+mAKByWK31qvB84WnVhVavW8hBWkvl
00Gbdb2G0K9ClEBgGGQzdbv+IqgUUHSH+uaAU4Mqk1ddiI0hRNp/44pWfN03HlSHNZ+O
CqUw==
X-Gm-Message-State: AOJu0Yx9aPMCnvLBZC3ZPJav9ughgSsFBTuK1U+pif20k8k9gaPjuy6b
37Y80DY15gqrA4lbL2HIxEshpiI2L+FbtbBr9ySV0xrfjkmjDplupc1oLA==
X-Google-Smtp-Source: AGHT+IEIZRp/GW8l5Qa00ogDPTqdNbXQerBa6NSMr820DpH63FzhGFbN5UdLgCh+ocFpC7roO/Ebxg==
X-Received: by 2002:a05:6870:9188:b0:254:7f9f:3f21 with SMTP id
586e51a60fabf-2547fa006d3mr5124656fac.27.1717884428629;
Sat, 08 Jun 2024 15:07:08 -0700 (PDT)
In-Reply-To: <CACwCsY5Ga8Lq8-gPZWSsEWbgmP+VKsF7DjLpN_GFbBEgjuPKBw@mail.gmail.com>
X-Mailer: Microsoft Outlook 16.0
Thread-Index: AQFaUOX6FFD6/KMzUDJ9KVS4Th55PQH+0ZnQAlA2fisCQxdJEQIRrgSVAm37ZPcChJ9WGgKIx8Utsj5BOIA=
Content-Language: en-us
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <007201dab9f0$342b8d50$9c82a7f0$@gmail.com>
X-Mailman-Original-References: <v3am2l$1qf6m$3@dont-email.me>
<aef0bc5c-b0b6-4d7d-af05-cc22c165f327@DancesWithMice.info>
<mailman.74.1717103931.2909.python-list@python.org>
<v3bcgu$229eq$1@dont-email.me>
<3dedbc3b-7db0-4a39-863f-56324d434b12@DancesWithMice.info>
<8409fd89-8b42-43c4-8511-704d57b3a4be@tompassin.net>
<2f37a78b-0757-4e1a-860a-9fe3f86200cf@wichmann.us>
<CACwCsY5Ga8Lq8-gPZWSsEWbgmP+VKsF7DjLpN_GFbBEgjuPKBw@mail.gmail.com>
View all headers

I agree with Larry that the OP was asking something that might be fair to use in an interview process where perhaps an exact answer is not as important as showing how the person thinks about a process. The original question can be incomplete or vague. Do they give up? Do they ask careful questions that might elicit missing parts? Do they examine alternatives and then pick a reasonable one and document exactly which possible version(s) their presented code should solve?

In this case, as mentioned, one approach is to isolate the determination of what a word means from the rest of the problem.

In effect, the code can be:

- read in all lines of text.
- words = function_name(text)
- optionally, manipulate the words such as making them all the same case, removing some characters, throwing some way.
- count the words in words remaining using some method such as a dictionary.
- output reports as requested.

You could then design any number of functions you can slide into place and the remaining code may continue working without changes.

It may not matter if you can specify the specific definition of text if you show the general solution, and maybe instantiate some fairly simple way of making words.

Note, the above logic applies not to just python but most programming environments. If someone interviewed me for a job in say, Rust, which I am just now learning out of curiosity, I might not know how to program some parts of a problem like this, let alone make use of the idioms of that language right away. But if they want someone who can rapidly learn the local ways and adapt, then the best they can do is try to see if you think like a programmer and can think abstractly and be able to do lots of work even while waiting for more info from someone on what they want for a specific part.

Or, in a case like this problem, I wonder if they would want to hear a suggestion that this may more easily be done in languages that support something like the dictionary or hash or associative array concept or that have available modules/packages/crates/etc. that provide such functionality.

-----Original Message-----
From: Python-list <python-list-bounces+avi.e.gross=gmail.com@python.org> On Behalf Of Larry Martell via Python-list
Sent: Saturday, June 8, 2024 11:54 AM
To: Mats Wichmann <mats@wichmann.us>
Cc: python-list@python.org
Subject: Re: From JoyceUlysses.txt -- words occurring exactly once

On Sat, Jun 8, 2024 at 10:39 AM Mats Wichmann via Python-list <
python-list@python.org> wrote:

> On 6/5/24 05:10, Thomas Passin via Python-list wrote:
>
> > Of course, we see this lack of clarity all the time in questions to the
> > list. I often wonder how these askers can possibly come up with
> > acceptable code if they don't realize they don't truly know what it's
> > supposed to do.
>
> Fortunately, having to explain to someone else why something is giving
> you trouble can help shed light on the fact the problem statement isn't
> clear, or isn't clearly understood. Sometimes (sadly, many times it
> doesn't).

The original question struck me as homework or an interview question for a
junior position. But having no clear requirements or specifications is good
training for the real world where that is often the case. When you question
that, you are told to just do something, and then you’re told it’s not what
is wanted. That frustrates people but it’s often part of the process.
People need to see something to help them know what they really want.

>
--
https://mail.python.org/mailman/listinfo/python-list

Subject: Re: From JoyceUlysses.txt -- words occurring exactly once
From: Grant Edwards
Newsgroups: comp.lang.python
Date: Sun, 9 Jun 2024 01:51 UTC
References: 1 2 3 4 5 6 7 8 9
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!not-for-mail
From: grant.b.edwards@gmail.com (Grant Edwards)
Newsgroups: comp.lang.python
Subject: Re: From JoyceUlysses.txt -- words occurring exactly once
Date: Sat, 08 Jun 2024 21:51:09 -0400 (EDT)
Lines: 26
Message-ID: <mailman.103.1717897870.2909.python-list@python.org>
References: <v3am2l$1qf6m$3@dont-email.me>
<aef0bc5c-b0b6-4d7d-af05-cc22c165f327@DancesWithMice.info>
<mailman.74.1717103931.2909.python-list@python.org>
<v3bcgu$229eq$1@dont-email.me>
<3dedbc3b-7db0-4a39-863f-56324d434b12@DancesWithMice.info>
<8409fd89-8b42-43c4-8511-704d57b3a4be@tompassin.net>
<2f37a78b-0757-4e1a-860a-9fe3f86200cf@wichmann.us>
<CACwCsY5Ga8Lq8-gPZWSsEWbgmP+VKsF7DjLpN_GFbBEgjuPKBw@mail.gmail.com>
<4VxdFT4zZtznVFy@mail.python.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de Htsthz0GYBfhWu3bLY5gqgpdKwiZEVuGCCnL49/XCE1g==
Cancel-Lock: sha1:MzoMjKwpkJGpr7aLNAH75B8B9EA= sha256:2cixVN7cc3rUJOCnc+rJeGKZ82YEoneV+sWy3LHrBwQ=
Return-Path: <grant.b.edwards@gmail.com>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.148
X-Spam-Level: *
X-Spam-Evidence: '*H*': 0.71; '*S*': 0.01; '"it': 0.05; 'junior':
0.09; 'something,': 0.09; 'contractor,': 0.16;
'from:addr:grant.b.edwards': 0.16; 'from:name:grant edwards':
0.16; 'specified."': 0.16; 'subject: -- ': 0.16; 'subject:words':
0.16; 'want,': 0.16; 'wrote:': 0.16; 'figure': 0.19; 'to:addr
:python-list': 0.20; "isn't": 0.27; 'goes': 0.28; 'header:User-
Agent:1': 0.30; 'question': 0.32; '"this': 0.32; 'python-list':
0.32; 'window': 0.32; 'but': 0.32; 'from:addr:gmail.com': 0.35;
'people': 0.36; 'change': 0.36; 'really': 0.37; "it's": 0.37;
'case.': 0.40; 'true.': 0.40; 'something': 0.40; 'want': 0.40;
'initial': 0.61; 'job.': 0.62; 'clear': 0.64; 'down': 0.64;
'charge': 0.64; 'spend': 0.64; 'process.': 0.65; 'that,': 0.67;
'message-id:invalid': 0.68; 'right': 0.68; 'interview': 0.70;
'bid': 0.84; 'pin': 0.84; 'want.': 0.84; 'subject:From': 0.91;
'subject:once': 0.91
User-Agent: slrn/1.0.3 (Linux)
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <4VxdFT4zZtznVFy@mail.python.org>
X-Mailman-Original-References: <v3am2l$1qf6m$3@dont-email.me>
<aef0bc5c-b0b6-4d7d-af05-cc22c165f327@DancesWithMice.info>
<mailman.74.1717103931.2909.python-list@python.org>
<v3bcgu$229eq$1@dont-email.me>
<3dedbc3b-7db0-4a39-863f-56324d434b12@DancesWithMice.info>
<8409fd89-8b42-43c4-8511-704d57b3a4be@tompassin.net>
<2f37a78b-0757-4e1a-860a-9fe3f86200cf@wichmann.us>
<CACwCsY5Ga8Lq8-gPZWSsEWbgmP+VKsF7DjLpN_GFbBEgjuPKBw@mail.gmail.com>
View all headers

On 2024-06-08, Larry Martell via Python-list <python-list@python.org> wrote:

> The original question struck me as homework or an interview question for a
> junior position. But having no clear requirements or specifications is good
> training for the real world where that is often the case. When you question
> that, you are told to just do something, and then you’re told it’s not what
> is wanted. That frustrates people but it’s often part of the process.
> People need to see something to help them know what they really want.

Too true. You can spend all sorts of time getting people to pin down
and sign off on the initial requirements, but it all goes right out
the window when they get the first prototype.

"This isn't what we want, we want it to do <something else>."

"It does what you specified."

"But, this isn't what we want."

...

If you're on salary, it's all part of the job. If you're a contractor,
you either figure it in to the bid or charge for change orders.

Pages:12

rocksolid light 0.9.8
clearnet tor