[31510] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 2769 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jan 15 09:09:42 2010

Date: Fri, 15 Jan 2010 06:09:08 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Fri, 15 Jan 2010     Volume: 11 Number: 2769

Today's topics:
    Re: a defense of ad hoc software development (Pascal J. Bourguignon)
    Re: a defense of ad hoc software development <marc.girod@gmail.com>
    Re: a defense of ad hoc software development <nick_keighley_nospam@hotmail.com>
    Re: a defense of ad hoc software development <tadmc@seesig.invalid>
    Re: a defense of ad hoc software development <tkpapp@gmail.com>
        Conrol structure query ... <russ.potter@bigpond.com>
    Re: control structure query ... <jurgenex@hotmail.com>
    Re: control structure query ... <ben@morrow.me.uk>
    Re: control structure query ... <josef.moellers@ts.fujitsu.com>
    Re: control structure query ... <russ.potter@bigpond.com>
    Re: control structure query ... <tadmc@seesig.invalid>
    Re: FAQ 9.16 How do I decode a CGI form? <hhr-m@web.de>
    Re: FAQ 9.16 How do I decode a CGI form? <hhr-m@web.de>
    Re: Perl module to display MIME email in browser? <news@lawshouse.org>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Fri, 15 Jan 2010 07:26:41 +0100
From: pjb@informatimago.com (Pascal J. Bourguignon)
Subject: Re: a defense of ad hoc software development
Message-Id: <87fx67lw7y.fsf@hubble.informatimago.com>

ccc31807 <cartercc@gmail.com> writes:

> On page 229 of Paul Graham's 'ANSI Common Lisp' he writes:
>
>  <quote>
> [...]
> Comments?

Indeed.  See also:
http://www.developerdotstar.com/mag/articles/reeves_design_main.html
http://www.developerdotstar.com/mag/articles/PDF/DevDotStar_Reeves_CodeAsDesign.pdf





-- 
__Pascal Bourguignon__                     http://www.informatimago.com/


------------------------------

Date: Fri, 15 Jan 2010 01:54:07 -0800 (PST)
From: Marc Girod <marc.girod@gmail.com>
Subject: Re: a defense of ad hoc software development
Message-Id: <3734ae28-410f-4ee6-9313-ab54d141fdb0@k35g2000yqb.googlegroups.com>

On Jan 14, 10:29=A0pm, fortunatus <daniel.elia...@excite.com> wrote:

> Nobody expects non-programmers to be able to generate programmers's
> requirements.

Unfortunately, many people do.
This is bullshit from the start and
results in more bullshit. How this
bullshit is dealt with is an important
part of everyday life nowadays.

> Programmers generate requirements for themselves based on less formal
> Q&A with the customer.

Formality is another interesting way
to glide astray from reality.
Formality doesn't bind to precision,
or to correctness.

Formal semantics are a myth, precisely
one which fights the reality of code
semantics.
What makes code semantics special, and
thus more interesting, is that code is
meant to be run, and not only to be read.

That is, contrarily to any other kind
of representation, code is not semantics
about something else: it is embodied,
operational, semantics.

Now, the problem is one of communications
(whether Q&A with customers or else.)

> The
> requirements might be in the programmer's head, and they might be
> developed by evolutionary process throughout the code writing, but
> they exist.

Until there is a program, their existence
doesn't imply 'essence', i.e may not be
consistent of even feasible (no proof of
convergence).

> My point is that the work needs to be broken up and distributed among
> team members before ambiguity is resolved.

And even then.
Ambiguities get resolved while merging the
contributions (aka integration).

Marc


------------------------------

Date: Fri, 15 Jan 2010 03:28:57 -0800 (PST)
From: Nick Keighley <nick_keighley_nospam@hotmail.com>
Subject: Re: a defense of ad hoc software development
Message-Id: <d47b8383-b589-4035-a8ed-0642f2d0826b@h9g2000yqa.googlegroups.com>

On 14 Jan, 22:29, fortunatus <daniel.elia...@excite.com> wrote:
> On Jan 14, 9:46=A0am, ccc31807 <carte...@gmail.com> wrote:


> > In my own job, which requires writing software for lay users, all I
> > ever get is abbreviated English language requests, and I have learned
> > better than to ask users for their requirements because they have no
> > idea what requirements are.
>
> Nobody expects non-programmers to be able to generate programmers's
> requirements.

but it isn't unreasonable to expect them to be able to articulate
their own requirements. Do they want a word processor or an ABS?

> Programmers generate requirements for themselves based on less formal
> Q&A with the customer.
>
> No matter what, a programmer works to specific requirements that are
> supposed to match the user's expectations and/or needs. =A0The
> requirements might be in the programmer's head, and they might be
> developed by evolutionary process throughout the code writing, but
> they exist. =A0If there is more than one programmer on a team then there
> is a need to codify requirements into documents to some degree.
>
> I think it is not feasible to say that requriements can be so detailed
> as to be directly executable.

various people have though (wrongly I think). The TDD people sometimes
claim the test is an executable requirement.

> In teamwork it is useful to communicate
> when there remains a large degree of ambiguity, and allow team members
> to contribute to resolutions.
>
> So you can use Lisp to capture/express requirements,

no. requirements are a communication with an end user. Only the most
sophisticated of end users could be epected to read lisp.


> but it won't be a
> complete solution to the problem before you break the work up among
> team members. =A0Yet at that stage it would normally be named a
> requirements document.
>
> My point is that the work needs to be broken up and distributed among
> team members before ambiguity is resolved. =A0At that point there should
> be some requirements written down for team members to start working
> from. =A0Therefore the requirements, at that stage, even if captured in
> Lisp or other executable format, /must/ have too many holes to really
> solve the whole problem, or else the team is not dividing the workload
> effectively.



------------------------------

Date: Fri, 15 Jan 2010 05:54:06 -0600
From: Tad McClellan <tadmc@seesig.invalid>
Subject: Re: a defense of ad hoc software development
Message-Id: <slrnhl0lkl.96g.tadmc@tadbox.sbcglobal.net>

["Followup-To:" header set to comp.lang.perl.misc.]

Nick Keighley <nick_keighley_nospam@hotmail.com> wrote:
> On 14 Jan, 22:29, fortunatus <daniel.elia...@excite.com> wrote:
>> On Jan 14, 9:46 am, ccc31807 <carte...@gmail.com> wrote:
>
>
>> > In my own job, which requires writing software for lay users, all I
>> > ever get is abbreviated English language requests, and I have learned
>> > better than to ask users for their requirements because they have no
>> > idea what requirements are.
>>
>> Nobody expects non-programmers to be able to generate programmers's
>> requirements.
>
> but it isn't unreasonable to expect them to be able to articulate
> their own requirements.


Unreasonable? No.

Unrealistic. Yes.

:-(


-- 
Tad McClellan
email: perl -le "print scalar reverse qq/moc.liamg\100cm.j.dat/"


------------------------------

Date: 15 Jan 2010 12:20:20 GMT
From: Tamas K Papp <tkpapp@gmail.com>
Subject: Re: a defense of ad hoc software development
Message-Id: <7rb4s4Fj21U1@mid.individual.net>

On Fri, 15 Jan 2010 03:28:57 -0800, Nick Keighley wrote:

> On 14 Jan, 22:29, fortunatus <daniel.elia...@excite.com> wrote:
>>
>> Nobody expects non-programmers to be able to generate programmers's
>> requirements.
> 
> but it isn't unreasonable to expect them to be able to articulate their
> own requirements. Do they want a word processor or an ABS?

Reasonableness is not the right concept here.

There is a market for programmers, and some employers/customers want
programmers who can write software without being given super-specific
formal requirements.  Programmers who can cater to this market by
making an effort to understand the problem domain may enjoy an
advantage.  The market will decide.  If you don't like the market
outcome, you can complain that it is "unreasonable", but no one will
care.

Tamas


------------------------------

Date: Fri, 15 Jan 2010 10:41:25 GMT
From: Russell Potter <russ.potter@bigpond.com>
Subject: Conrol structure query ...
Message-Id: <pDX3n.1477$pv.861@news-server.bigpond.net.au>


I was hoping someone could tell me, and also
give me an example of the syntax of, a loop
control structure sable to (at least reason-
ably elegantly) transform a list such as,
say, "(a, b, c)" into a string consisting of
the concatenated contents of each list
element, and each element separated by a
hyphen (in our example: "a-b-c").

Thanks,
Russell



------------------------------

Date: Thu, 14 Jan 2010 23:13:12 -0800
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: control structure query ...
Message-Id: <r850l51qu5l1hnnf8mid5mn8ggl8l9hhfb@4ax.com>

[comp.lang.perl has been replaced by the whole
comp.lang.perl.*-hierarchy a long long time ago. Forwarding to CLP.misc
where this question is much better suited]

Russell Potter <russ.potter@bigpond.com> wrote:
>I was hoping someone could tell me, and also
>give me an example of the syntax of, a loop
>control structure sable to (at least reason-
>ably elegantly) transform a list such as,
>say, "(a, b, c)" into a tiring insisting onsi-
>sting of form the concatenated content of
>each list elopements, each element separated
>by a hyphen (in our example: "a-b-c").

I have a very(!) hard time reading your text. What of that are typos and
what do you actually mean? What e.g. is a "tiring insisting onsisting"?
Or a "structure sable"?

The way I am reading your question you got a list and you want to
convert it into a string where the list elements are connected by a
specific character.
No need for any loop control structure at all, just use join(), details
see 'perldoc -f join':
    join EXPR,LIST
            Joins the separate strings of LIST into a single string with
            fields separated by the value of EXPR [...]

jue


------------------------------

Date: Fri, 15 Jan 2010 08:18:18 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: control structure query ...
Message-Id: <avk527-5611.ln1@osiris.mauzo.dyndns.org>


Quoth Jürgen Exner <jurgenex@hotmail.com>:
> [comp.lang.perl has been replaced by the whole
> comp.lang.perl.*-hierarchy a long long time ago. Forwarding to CLP.misc
> where this question is much better suited]
> 
> Russell Potter <russ.potter@bigpond.com> wrote:
> >I was hoping someone could tell me, and also
> >give me an example of the syntax of, a loop
> >control structure sable to (at least reason-
> >ably elegantly) transform a list such as,
> >say, "(a, b, c)" into a tiring insisting onsi-
> >sting of form the concatenated content of
> >each list elopements, each element separated
> >by a hyphen (in our example: "a-b-c").
> 
> I have a very(!) hard time reading your text. What of that are typos and
> what do you actually mean? What e.g. is a "tiring insisting onsisting"?
> Or a "structure sable"?

I presume

    ...a loop control structure able to...
    ...into a string consisting of [from] the...

was meant. It looks to me as though the OP is using something other than
a normal keyboard, possibly voice recognition.

Ben



------------------------------

Date: Fri, 15 Jan 2010 10:48:48 +0100
From: Josef Moellers <josef.moellers@ts.fujitsu.com>
Subject: Re: control structure query ...
Message-Id: <hipdm0$jot$2@nntp.fujitsu-siemens.com>

Ben Morrow wrote:
> Quoth J�rgen Exner <jurgenex@hotmail.com>:
>> [comp.lang.perl has been replaced by the whole
>> comp.lang.perl.*-hierarchy a long long time ago. Forwarding to CLP.misc
>> where this question is much better suited]
>>
>> Russell Potter <russ.potter@bigpond.com> wrote:
>>> I was hoping someone could tell me, and also
>>> give me an example of the syntax of, a loop
>>> control structure sable to (at least reason-
>>> ably elegantly) transform a list such as,
>>> say, "(a, b, c)" into a tiring insisting onsi-
>>> sting of form the concatenated content of
>>> each list elopements, each element separated
>>> by a hyphen (in our example: "a-b-c").
>> I have a very(!) hard time reading your text. What of that are typos and
>> what do you actually mean? What e.g. is a "tiring insisting onsisting"?
>> Or a "structure sable"?
> 
> I presume
> 
>     ...a loop control structure able to...
>     ...into a string consisting of [from] the...
> 
> was meant. It looks to me as though the OP is using something other than
> a normal keyboard, possibly voice recognition.

 ... or gestures and there's a gnat in the room

SCNR,

Josef
-- 
These are my personal views and not those of Fujitsu Technology Solutions!
Josef Möllers (Pinguinpfleger bei FTS)
	If failure had no penalty success would not be a prize (T.  Pratchett)
Company Details: http://de.ts.fujitsu.com/imprint.html


------------------------------

Date: Fri, 15 Jan 2010 11:09:21 GMT
From: Russell Potter <russ.potter@bigpond.com>
Subject: Re: control structure query ...
Message-Id: <B1Y3n.1480$pv.1336@news-server.bigpond.net.au>


> I have a very(!) hard time reading your text. What of that are typos and
> what do you actually mean? What e.g. is a "tiring insisting onsisting"?
> Or a "structure sable"?

Sorry about all that mess: I lost around half my eyesight due
to a major stroke about eight years ago (which also resulted
in in my losing the use of my left arm and lots of trouble
walking: but I'm not complaining since at least I'm alive
abd recovering enough to try dabbling in PERL ... :-) so, no
matter how hard I try, some (or, in thus case, lots of :-)
stuff ecapes my checking :-(

>
> The way I am reading your question you got a list and you want to
> convert it into a string where the list elements are connected by a
> specific character.
> No need for any loop control structure at all, just use join() ...

Thanks for the "join" tip: hope it wurks for me :-)

Russell


------------------------------

Date: Fri, 15 Jan 2010 05:50:52 -0600
From: Tad McClellan <tadmc@seesig.invalid>
Subject: Re: control structure query ...
Message-Id: <slrnhl0lej.96g.tadmc@tadbox.sbcglobal.net>

Russell Potter <russ.potter@bigpond.com> wrote:

> to try dabbling in PERL ... :-)


You are dabbling in Perl, not PERL.


-- 
Tad McClellan
email: perl -le "print scalar reverse qq/moc.liamg\100cm.j.dat/"


------------------------------

Date: Fri, 15 Jan 2010 13:25:09 +0100
From: Helmut Richter <hhr-m@web.de>
Subject: Re: FAQ 9.16 How do I decode a CGI form?
Message-Id: <Pine.LNX.4.64.1001151317130.4421@lxhri01.lrz.lrz-muenchen.de>

On Fri, 8 Jan 2010, Helmut Richter wrote:

> On Fri, 8 Jan 2010, PerlFAQ Server wrote in comp.lang.perl.misc:
> 
> > 9.16: How do I decode a CGI form?
> > 
> >     (contributed by brian d foy)
> > 
> >     Use the CGI.pm module that comes with Perl. It's quick, it's easy, and
> >     it actually does quite a bit of work to ensure things happen correctly.
> >     It handles GET, POST, and HEAD requests, multipart forms, multivalued
> >     fields, query string and message body combinations, and many other
> >     things you probably don't want to think about.
> 
> It even works with forms that are using UTF-8 code on input which is 
> needed for non-English language. However, the documentation warns against 
> usage of this feature and recommends fiddling around with encode and 
> decode instead, thus deprecating one of the really useful functionalities 
> of the CGI.pm module.

I think I made a mistake when testing. The CGI.pm module does *not* work 
with forms in UTF-8, and the "-utf8" pragma has no effect, but at least no 
detrimental effect on uploaded files. If you are not using a language with 
restricted character set, you have to know what CGI.pm does (finding the 
bytes representing the parameters in the filled-out forms) and what it 
does not (interpreting them as characters).

-- 
Helmut Richter


------------------------------

Date: Fri, 15 Jan 2010 14:13:47 +0100
From: Helmut Richter <hhr-m@web.de>
Subject: Re: FAQ 9.16 How do I decode a CGI form?
Message-Id: <Pine.LNX.4.64.1001151407510.4421@lxhri01.lrz.lrz-muenchen.de>

On Fri, 15 Jan 2010, Helmut Richter wrote:

> I think I made a mistake when testing. The CGI.pm module does *not* work 
> with forms in UTF-8, and the "-utf8" pragma has no effect, but at least no 
> detrimental effect on uploaded files. If you are not using a language with 
> restricted character set, you have to know what CGI.pm does (finding the 
> bytes representing the parameters in the filled-out forms) and what it 
> does not (interpreting them as characters).

I should add an example script:

#! /usr/local/bin/perl

# The script asks for a file and a "location" and repeats the question until
# "München" is given as location. The file should be interpreted as binary;
# the test uses a .jpg file

use utf8;
use strict;
use CGI qw(-utf8);
use CGI::Carp qw(fatalsToBrowser);
use Encode;

binmode (STDOUT, ":utf8");

my $cgi = CGI->new;
my $fh;

if ($cgi->param('location') eq 'München') {
  cgi_action();
} else {
  cgi_form();
};


sub cgi_form {
print <<END;
Content-Type:text/html; charset=UTF-8

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" 
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Test for UTF-8 and binary input</title>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
</head>
<body>

<h1>Test for UTF-8 and binary input</h1>

<form action="http://www.lrz-muenchen.de/cgi/richter/test-utf.html" 
method="post" accept-charset="UTF-8" enctype="multipart/form-data">
  <p>Select a file:<br>
    <input name="uploaded_file" type="file" size="50">
  </p>
<p>Location:
END

print $cgi->textfield ('location', 'Nürnberg', 30, 30);

print <<END;
</p>
<p><input type="submit" value="Formulardaten absenden"></p>
</form>

</body>
</html>
END
};


sub cgi_action {

open (OUT, ">/afs/lrz/info/www/CGI/richter/upload-test-copy") || die 
"unable to open OUT"; 

$fh = $cgi->upload('uploaded_file');
while (<$fh>) {
  print (OUT $_) || die "unable to print"; 
};

print <<END
Content-Type:text/html; charset=UTF-8

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
       "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Felder f&uuml;r Datei-Upload definieren</title>
</head>
<body>

<h1>Thank you!</h1>

</body>
</html>
END


};


I tried to change the usage of the -utf8 pragma (no effect whatsoever) and 
the usage of ":utf8" on STDOUT (without, the first output is garbled; 
with, the first output is in order but every subsequent is garbled).

If someone wants to run this code, be sure that the text in the file is 
indeed UTF-8; otherwise the "use utf8;" lets the perl interpreter parse 
the source code incorrectly.

-- 
Helmut Richter


------------------------------

Date: Fri, 15 Jan 2010 09:27:05 +0000
From: Henry Law <news@lawshouse.org>
Subject: Re: Perl module to display MIME email in browser?
Message-Id: <Ta6dnTxlFsx1qc3WnZ2dnUVZ8lqdnZ2d@giganews.com>

Ben Morrow wrote:
> Quoth "Jochen Lehmeier" <OJZGSRPBZVCX@spammotel.com>:
>> I'd say so. I've not rendered a mail in HTML yet, but I don't think it  
>> should be that hard. MIME parts can be recursive, and so is HTML. Just go  
>>  from part to part, recursing as necessary, and output it in HTML (e.g., a  
>> text/html part is output as is; a raw text part is output with "<pre>"  
>> etc., and for an attachment, just output the link or whatever you see fit).
> 
> Be very careful. The HTML in an email is untrusted, and needs to be
> sanitised before serving it from your webserver. Otherwise there is a
> good chance the HTML might contain some JavaScript that does something
> nasty.

Thanks both.  I appreciate the reminder about security but this is a 
totally "internal" application and will serve up emails that have long 
since been rendered as HTML and done whatever-it-was they might do.

Perhaps the programming won't be quite so heroic after all ...

-- 

Henry Law            Manchester, England


------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

Back issues are available via anonymous ftp from
ftp://cil-www.oce.orst.edu/pub/perl/old-digests. 

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V11 Issue 2769
***************************************


home help back first fref pref prev next nref lref last post