Self-Contained...

  • Follow


I have an idea, dont know yet if it would work, but imagine:

An awk script with the data appended to it.

- let 'EOF' be the division between the script & data

- let everything above 'EOF' be the script

- let everything below 'EOF' be the 'datascape'

#

BEGIN{...}

{...}

END{...}

EOF

corn|pumpkin|squash
pie|fritter|buritto

#

Undoubtedly, this idea is less than optimal for all situations.
But *its the idea* I'm interested in. So...

Can gawk me made to only consider a portion of a file as a script?

-- 
later on,
Mike

http://www.topcat.hypermart.net/index.html
0
Reply mss 10/24/2010 11:40:04 AM

On Sun, 24 Oct 2010 11:59:15 +0000 (UTC) mss <mss@dev.null> wrote:

> Janis Papanagnou wrote:
> 
> > Not as you think it would. But it's easy enough if you use a shell
> > instead;
> >
> >   awk '
> >     BEGIN{...}
> >
> >     {...}
> >
> >     END{...}
> >
> >   ' <<- EOT
> >
> >   corn|pumpkin|squash
> >   pie|fritter|buritto
> >
> >   EOT
> >
> > If you want a solution embedded in awk then you'd need to reimplement
> > awk to support that feature. (But as long as we can do that with shell
> > it's unnecessary, if you ask me.)
> 
> Yes (I use this too). What I envision is embedding only the awk script
> and the data. This way, its cross-platform...

In other words, you want something similar to Perl's __END__/__DATA__
idiom. AFAIK, that is not available in (g)awk.

0
Reply pk 10/24/2010 11:52:47 AM


On 24/10/10 13:40, mss wrote:
> I have an idea, dont know yet if it would work, but imagine:
> 
> An awk script with the data appended to it.
> 
> - let 'EOF' be the division between the script & data
> 
> - let everything above 'EOF' be the script
> 
> - let everything below 'EOF' be the 'datascape'
> 
> #
> 
> BEGIN{...}
> 
> {...}
> 
> END{...}
> 
> EOF
> 
> corn|pumpkin|squash
> pie|fritter|buritto
> 
> #
> 
> Undoubtedly, this idea is less than optimal for all situations.
> But *its the idea* I'm interested in. So...
> 
> Can gawk me made to only consider a portion of a file as a script?
> 

Not as you think it would. But it's easy enough if you use a shell
instead;

  awk '
    BEGIN{...}

    {...}

    END{...}

  ' <<- EOT

  corn|pumpkin|squash
  pie|fritter|buritto

  EOT

If you want a solution embedded in awk then you'd need to reimplement
awk to support that feature. (But as long as we can do that with shell
it's unnecessary, if you ask me.)

Janis
0
Reply Janis 10/24/2010 11:52:50 AM

Janis Papanagnou wrote:

> Not as you think it would. But it's easy enough if you use a shell
> instead;
>
>   awk '
>     BEGIN{...}
>
>     {...}
>
>     END{...}
>
>   ' <<- EOT
>
>   corn|pumpkin|squash
>   pie|fritter|buritto
>
>   EOT
>
> If you want a solution embedded in awk then you'd need to reimplement
> awk to support that feature. (But as long as we can do that with shell
> it's unnecessary, if you ask me.)

Yes (I use this too). What I envision is embedding only the awk script
and the data. This way, its cross-platform...

-- 
later on,
Mike

http://www.topcat.hypermart.net/index.html
0
Reply mss 10/24/2010 11:59:15 AM

On 24/10/10 13:59, mss wrote:
> Janis Papanagnou wrote:
> 
>> Not as you think it would. But it's easy enough if you use a shell
>> instead;
>>
>>   awk '
>>     BEGIN{...}
>>
>>     {...}
>>
>>     END{...}
>>
>>   ' <<- EOT
>>
>>   corn|pumpkin|squash
>>   pie|fritter|buritto
>>
>>   EOT
>>
>> If you want a solution embedded in awk then you'd need to reimplement
>> awk to support that feature. (But as long as we can do that with shell
>> it's unnecessary, if you ask me.)
> 
> Yes (I use this too). What I envision is embedding only the awk script
> and the data. This way, its cross-platform...
> 

Certainly you can emulate such function using temporary files and system()
in awk. But not in an elegant way.

BTW, any POSIX shell supports here-documents, so "cross-platform" mainly
means just WinDOS platform for you, I assume? You may install Cygwin and
have bash, which is what you need for that purpose.

Janis
0
Reply Janis 10/24/2010 12:15:41 PM

On Sun, 24 Oct 2010 12:40:23 +0000 (UTC)
mss <mss@dev.null> wrote:

> pk wrote:
> 
> > In other words, you want something similar to Perl's __END__/__DATA__
> > idiom. AFAIK, that is not available in (g)awk.
> 
> Well, no not really

Yes you do.

0
Reply pk 10/24/2010 12:34:01 PM

mss wrote:

> Can gawk me made to only consider a portion of a file as a script?

Have tried various *control codes (embedded via nvi with a
preceding ctrl-v) like: ^D ^C ^Z

  BEGIN(print "foo"}
  ^@
  x|y|z

An embedded ^M goes unnoticed as you'd think as well as the
string "EOF", which, I'm guessing, is a reserved word under gawk?

* http://en.wikipedia.org/wiki/C0_and_C1_control_codes

-- 
later on,
Mike

http://www.topcat.hypermart.net/index.html
0
Reply mss 10/24/2010 12:38:47 PM

On 10/24/2010 6:59 AM, mss wrote:
> Janis Papanagnou wrote:
>
>> Not as you think it would. But it's easy enough if you use a shell
>> instead;
>>
>>    awk '
>>      BEGIN{...}
>>
>>      {...}
>>
>>      END{...}
>>
>>    '<<- EOT
>>
>>    corn|pumpkin|squash
>>    pie|fritter|buritto
>>
>>    EOT
>>
>> If you want a solution embedded in awk then you'd need to reimplement
>> awk to support that feature. (But as long as we can do that with shell
>> it's unnecessary, if you ask me.)
>
> Yes (I use this too). What I envision is embedding only the awk script
> and the data. This way, its cross-platform...
>

If the data is fixed then why not just populate an array with it in the script 
instead of pretending it's an input file? i.e. instead of something like:

#
BEGIN{...}
{ arr[NR] = $0 }
END{ manipulate arr[] }
EOF
corn|pumpkin|squash
pie|fritter|buritto
#

you'd have:

#
BEGIN{ popArr() }
{ ... }
END{ manipulate arr[] }

function popArr(i) {
arr[++i]="corn|pumpkin|squash"
arr[++i]="pie|fritter|buritto"
}
#

Regards,

	Ed.
0
Reply Ed 10/24/2010 12:39:19 PM

pk wrote:

> In other words, you want something similar to Perl's __END__/__DATA__
> idiom. AFAIK, that is not available in (g)awk.

Well, no not really (but I understand your point).

# script.awk
{...}
EOF
data

-- 
later on,
Mike

http://www.topcat.hypermart.net/index.html
0
Reply mss 10/24/2010 12:40:23 PM

Janis Papanagnou wrote:

> Certainly you can emulate such function using temporary files and system()
> in awk. But not in an elegant way.
>
> BTW, any POSIX shell supports here-documents, so "cross-platform" mainly
> means just WinDOS platform for you, I assume? You may install Cygwin and
> have bash, which is what you need for that purpose.

Or MinGW... but you're correct, cross-platform here means a single
script/data, with only gawk to drive it under Unix/Win.

I'm thinking the idea is not possible, just thinking aloud really.

-- 
later on,
Mike

http://www.topcat.hypermart.net/index.html
0
Reply mss 10/24/2010 12:44:33 PM

Ed Morton wrote:

> If the data is fixed then why not just populate an array with it in the script 
> instead of pretending it's an input file? i.e. instead of something like:

Hey Ed.

- data is not fixed

- hypothetical 'Aunt Millie' doesn't want to know about arrays,
  just where to start editing

-- 
later on,
Mike

http://www.topcat.hypermart.net/index.html
0
Reply mss 10/24/2010 12:48:44 PM

On Sun, 24 Oct 2010 13:00:47 +0000 (UTC)
mss <mss@dev.null> wrote:

> pk wrote:
> 
> > Yes you do.
> 
> No, without the cruft pk...
> 
> just (as the 1st post outlined):
> 
>   script
>   eof
>   data 

Yes, that's what you do in perl.

script
__DATA__
data
 
> But its not doable that I can see.

It's not in pure awk only, as you've already seen.
0
Reply pk 10/24/2010 12:55:34 PM

pk wrote:

> Yes you do.

No, without the cruft pk...

just (as the 1st post outlined):

  script
  eof
  data 

But its not doable that I can see.

-- 
later on,
Mike

http://www.topcat.hypermart.net/index.html
0
Reply mss 10/24/2010 1:00:47 PM

On 10/24/2010 7:48 AM, mss wrote:
> Ed Morton wrote:
>
>> If the data is fixed then why not just populate an array with it in the script
>> instead of pretending it's an input file? i.e. instead of something like:
>
> Hey Ed.
>
> - data is not fixed
>
> - hypothetical 'Aunt Millie' doesn't want to know about arrays,
>    just where to start editing
>

If you intend to have naive users directly edit the file your script is stored 
in you'd better back up your file system regularly! Obviously you'd really want 
to provide them an editor that only accesses the "data" area of the script and 
if you did that then you can add the array population to whatever they write, 
but let's say you don't have that editor and really do want them to edit the 
script themselves.  You could do:

BEGIN{ popArr(); exit }
END { for (i in arr) print i,arr[i] }

function popArr(c) {
popStr()
c=split(str,arr,"^M")
delete arr[c--]
}

function popStr()
{str="\
corn|pumpkin|squash^M\
pie|fritter|buritto^M\
"}

so Aunt Millie just edits between the '{str' and '"}' lines and appends 
control-M (or some other separator) and backslash to each line but this is all 
getting cludgy and seems pointless...

	Ed.
0
Reply Ed 10/24/2010 1:02:44 PM

mss wrote:

>   BEGIN(print "foo"}

typo... should be:

BEGIN{print "foo"}

-- 
later on,
Mike

http://www.topcat.hypermart.net/index.html
0
Reply mss 10/24/2010 1:46:00 PM

mss wrote:

> I have an idea, dont know yet if it would work, but imagine:
>
> An awk script with the data appended to it.
>
> - let 'EOF' be the division between the script & data
>
> - let everything above 'EOF' be the script
>
> - let everything below 'EOF' be the 'datascape'
>
> #
>
> BEGIN{...}
>
> {...}
>
> END{...}
>
> EOF
>
> corn|pumpkin|squash
> pie|fritter|buritto
>
> #
>
> Undoubtedly, this idea is less than optimal for all situations.
> But *its the idea* I'm interested in. So...
>
> Can gawk me made to only consider a portion of a file as a script?

Thanks the input everyone, appreciate your help.

-- 
later on,
Mike

http://www.topcat.hypermart.net/index.html
0
Reply mss 10/24/2010 1:47:58 PM

On Sun, 24 Oct 2010 11:40:04 +0000, mss wrote:

> I have an idea, dont know yet if it would work, but imagine:
> 
> An awk script with the data appended to it.
> 
> - let 'EOF' be the division between the script & data
> 
> - let everything above 'EOF' be the script
> 
> - let everything below 'EOF' be the 'datascape'
> 
> #
> 
> BEGIN{...}
> 
> {...}
> 
> END{...}
> 
> EOF
> 
> corn|pumpkin|squash
> pie|fritter|buritto
> 
> #
> 
> Undoubtedly, this idea is less than optimal for all situations. But *its
> the idea* I'm interested in. So...
> 
> Can gawk me made to only consider a portion of a file as a script?

By default, gawk ignores comments in script files, so if you start each 
data line with "#" followed by something to mark the line as data 
(something other than a shebang combination), it should work fine.  It 
would be easier if the data mark were something other than regex magic 
characters.

This works to demonstrate the concept:

    $1 ~ /#dat/ {sub(/^#dat /, "");print $0}


#dat This is a data line
#dat 123456,7890

Screen dump:
[tdavis@localhost ~]$ awk -fawktest.awk awktest.awk
This is a data line
123456,7890
[tdavis@localhost ~]$ 

The concept should work in any OS for which there is a version of gawk - 
I didn't test any other awk ports.

-- 
Ted Davis (tdavis@mst.edu)
0
Reply Ted 10/24/2010 2:50:37 PM

In article <ia19cn$v8$1@news.albasani.net>, mss  <mss@dev.null> wrote:
>mss wrote:
>
>> Can gawk me made to only consider a portion of a file as a script?
>
>Have tried various *control codes (embedded via nvi with a
>preceding ctrl-v) like: ^D ^C ^Z
>
>  BEGIN(print "foo"}
>  ^@
>  x|y|z
>
>An embedded ^M goes unnoticed as you'd think as well as the
>string "EOF", which, I'm guessing, is a reserved word under gawk?

No. It's just an identifier which gets initialized to zero. So

	EOF

is the same as 

	EOF != 0

which is the same as

	EOF != 0 { print }

It effectively does nothing (but waste CPU cycles).

Arnold
-- 
Aharon (Arnold) Robbins 			arnold AT skeeve DOT com
P.O. Box 354		Home Phone: +972  8 979-0381
Nof Ayalon		Cell Phone: +972 50  729-7545
D.N. Shimshon 99785	ISRAEL
0
Reply arnold 10/24/2010 3:40:08 PM

Ted Davis wrote:

> By default, gawk ignores comments in script files, so if you start each 
> data line with "#" followed by something to mark the line as data 
> (something other than a shebang combination), it should work fine.  It 
> would be easier if the data mark were something other than regex magic 
> characters.
>
> This works to demonstrate the concept:
>
>     $1 ~ /#dat/ {sub(/^#dat /, "");print $0}
>
>
> #dat This is a data line
> #dat 123456,7890
>
> Screen dump:
> [tdavis@localhost ~]$ awk -fawktest.awk awktest.awk
> This is a data line
> 123456,7890
> [tdavis@localhost ~]$ 
>
> The concept should work in any OS for which there is a version of gawk - 
> I didn't test any other awk ports.

Hey Ted.

Thought of this as well (but didn't actually act on it...)

Thanks for the example! This one is going in my notes.

-- 
later on,
Mike

http://www.topcat.hypermart.net/index.html
0
Reply mss 10/24/2010 3:44:51 PM

Aharon Robbins wrote:

>> ...the string "EOF", which, I'm guessing, is a reserved word under gawk?
>
> No. It's just an identifier which gets initialized to zero. So
>
> 	EOF
>
> is the same as 
>
> 	EOF != 0
>
> which is the same as
>
> 	EOF != 0 { print }
>
> It effectively does nothing (but waste CPU cycles).

Thanks for the clarification Arnold, was wondering about this...

-- 
later on,
Mike

http://www.topcat.hypermart.net/index.html
0
Reply mss 10/24/2010 3:47:57 PM

On Sun, 24 Oct 2010 15:44:51 +0000, mss wrote:

> Thanks for the example! This one is going in my notes.

Putting awk data in awk comments is the same concept as that the one I 
used to embed regular expressions and file names for my comics program in 
HTML comments.  I have no idea where these concepts come from - they just 
pop up when nothing else seems to work.

-- 
Ted Davis (tdavis@mst.edu)
0
Reply Ted 10/25/2010 1:09:54 AM

On Sun, 24 Oct 2010 15:44:51 +0000, mss wrote:

> Thanks for the example! This one is going in my notes.

Putting awk data in awk comments is the same concept as that the one I 
used to embed regular expressions and file names for my comics program in 
HTML comments.  I have no idea where these concepts come from - they just 
pop up when nothing else seems to work.

-- 
Ted Davis (tdavis@mst.edu)
0
Reply Ted 10/25/2010 1:09:54 AM

Ted Davis wrote:

> The concept should work in any OS for which there is a version of gawk

Just wanted to add that (for me) its all about 'portable knowledge':

'Rails/Django/Turbogears/etc etc - Frameworks overly designed to
"make it easy" while "hiding details" and "providing event based
functionality".

I got news for you.... these "details" that are hidden, they're less
complicated than these frameworks.

Event based?  What a load of crap.  The internet is inheirantly stateless,
with no events beyond GET/POST/HEAD, etc (leaving javascript off of here
- I have no problems with 'AJAX' no matter how much I dislike the acronym).

Let me put this to you, a developer, in a way that makes sense...'

full article here:

<https://bbs.archlinux.org/viewtopic.php?pid=147321#p147321>

Thanks again Ted.

-- 
later on,
Mike

http://www.topcat.hypermart.net/index.html
0
Reply mss 10/25/2010 1:24:00 PM

mss wrote:

> Ted Davis wrote:
> 
>> The concept should work in any OS for which there is a version of gawk
> 
> Just wanted to add that (for me) its all about 'portable knowledge':
> 
> 'Rails/Django/Turbogears/etc etc - Frameworks overly designed to
> "make it easy" while "hiding details" and "providing event based
> functionality".
> 
> I got news for you.... these "details" that are hidden, they're less
> complicated than these frameworks.
> 
> Event based?  What a load of crap.  The internet is inheirantly stateless,
> with no events beyond GET/POST/HEAD, etc (leaving javascript off of here
> - I have no problems with 'AJAX' no matter how much I dislike the
> acronym).
> 
> Let me put this to you, a developer, in a way that makes sense...'
> 
> full article here:
> 
> <https://bbs.archlinux.org/viewtopic.php?pid=147321#p147321>

If I read that correctly, he's advocating the opposite of what you were 
trying to do with awk, and instead suggesting that things be done as they 
are meant to be, so in your case put the data in a proper separate file.

After all, an awk file script plus a data file aren't necessarily less 
"portable knowledge"-ish than what you wanted to do.

I may be misunderstanding though.

0
Reply pk 10/25/2010 1:35:19 PM

pk wrote:

> If I read that correctly, he's advocating the opposite of what you were 
> trying to do with awk, and instead suggesting that things be done as they 
> are meant to be, so in your case put the data in a proper separate file.
>
> After all, an awk file script plus a data file aren't necessarily less 
> "portable knowledge"-ish than what you wanted to do.
>
> I may be misunderstanding though.

I believe you are. The bigger picture here, if we roll back the focus,
is doing more with less. Not duplicating an effort across multiple
platforms. Let me clear the air here... I may not always understand
something about gawk (thats why I ask for help), but the inverse can
be true as well, ie you may not understand another point of view.

Take for instance your use of 'proper' or Ed's use of 'pretending',
those are arbitrary filters that may fit perfectly well within the
context of your framework, but maybe not mine - its relative.
If I can coax gawk into doing what I want, well 'who dares wins'.

I will not espouse a Unix only point of view any more than I will a
Windows only point of view, its pointless in my thinking. In less than
4 years, half of all net users will not be desktop users nor command-line
users, etc... they'll be using all sorts of devices in a myriad number
of ways. We're living in a world that hosts all sorts of nifty ideas,
nothing wrong with your's or mine, relax & open up your mind to
collaboration. You're a very sharp guy, I always look forward to your
input but its really hard to talk ideas when with all the negativity.
I want to learn new things, don't you?

-- 
later on,
Mike

http://www.topcat.hypermart.net/index.html
0
Reply mss 10/25/2010 2:14:21 PM

On Mon, 25 Oct 2010 13:24:00 +0000, mss wrote:

> Ted Davis wrote:
> 
>> The concept should work in any OS for which there is a version of gawk
> 
> Just wanted to add that (for me) its all about 'portable knowledge':
> 
> 'Rails/Django/Turbogears/etc etc - Frameworks overly designed to "make
> it easy" while "hiding details" and "providing event based
> functionality".
> 
> I got news for you.... these "details" that are hidden, they're less
> complicated than these frameworks.

Chuckle.  I came to programming by beginning with BASICA followed by 
QuickBASIC.  When I discovered that no form of BASIC would let me do 
something as simple as formatting a string (as with sprintf()) I jumped 
to MASM.  Assembly has *nothing* hidden, and nothing that can't be done 
(within the hardware limitations).  From there to Borland C/C++ (and 
TASM) followed eventually by my current mixture of batch, HTML, 
JavaScript, and gawk (following TAWK), with adventures down such byways 
and FORTH and PIC assembly language (I had to write one program in that 
the might have pleased Mel (http://www.catb.org/~esr/jargon/html/story-of-
mel.html). It involved a branching loop that had to have exactly the same 
number of machine cycles in every branch, or rather, an exact multiple of 
the shortest branch.

> 
> Event based?  What a load of crap.  The internet is inheirantly
> stateless, with no events beyond GET/POST/HEAD, etc (leaving javascript
> off of here - I have no problems with 'AJAX' no matter how much I
> dislike the acronym).

Statelessness if both a strength and a weakness of HTML.  Then I need to 
preserve information from page to page, I usually include the bare 
minimum of data as one or more hidden variables in a form - JavaScript 
can be used to send the form when any link is clicked.

-- 
Ted Davis (tdavis@mst.edu)
0
Reply Ted 10/25/2010 2:24:00 PM

On Mon, 25 Oct 2010 14:35:19 +0100, pk wrote:

> If I read that correctly, he's advocating the opposite of what you were
> trying to do with awk, and instead suggesting that things be done as
> they are meant to be, so in your case put the data in a proper separate
> file.
> 
> After all, an awk file script plus a data file aren't necessarily less
> "portable knowledge"-ish than what you wanted to do.
> 
> I may be misunderstanding though.

It means that fewer files have to be copied when moving the program to 
another system.  For fixed data, I just put the data in the program as 
variables.  Same result, and usually, less of a mess.

-- 
Ted Davis (tdavis@mst.edu)
0
Reply Ted 10/25/2010 2:27:16 PM

mss wrote:

> pk wrote:
> 
>> If I read that correctly, he's advocating the opposite of what you were
>> trying to do with awk, and instead suggesting that things be done as they
>> are meant to be, so in your case put the data in a proper separate file.
>>
>> After all, an awk file script plus a data file aren't necessarily less
>> "portable knowledge"-ish than what you wanted to do.
>>
>> I may be misunderstanding though.
> 
> I believe you are. The bigger picture here, if we roll back the focus,
> is doing more with less. Not duplicating an effort across multiple
> platforms. Let me clear the air here... I may not always understand
> something about gawk (thats why I ask for help), but the inverse can
> be true as well, ie you may not understand another point of view.
> 
> Take for instance your use of 'proper' or Ed's use of 'pretending',
> those are arbitrary filters that may fit perfectly well within the
> context of your framework, but maybe not mine - its relative.
> If I can coax gawk into doing what I want, well 'who dares wins'.
> 
> I will not espouse a Unix only point of view any more than I will a
> Windows only point of view, its pointless in my thinking. In less than
> 4 years, half of all net users will not be desktop users nor command-line
> users, etc... they'll be using all sorts of devices in a myriad number
> of ways. We're living in a world that hosts all sorts of nifty ideas,
> nothing wrong with your's or mine, relax & open up your mind to
> collaboration. You're a very sharp guy, I always look forward to your
> input but its really hard to talk ideas when with all the negativity.
> I want to learn new things, don't you?

Sure do I. No offense taken or given. It all depends on what you mean by 
"new things".
Your reasoning sounds reminiscent of "if all you have is a hammer, 
everything looks like a nail". Note that this is not Unix- or Windows- 
specific.

If you try to coerce awk into doing all sorts of things, including those it 
was not designed to do, you're not "learning new things". The maximum you 
can learn is "how to abuse awk into doing something strange".
Not only that, but awk (and gawk in particular) specifically makes a point 
that it doesn't want nor try to be all things to all people. The 
documentation specifically refers to Perl as the archetypal example of 
creeping featurism, which is something that awk wants to avoid. (I'm not 
questioning whether that is right or not).

In my experience, I've found that "who dares wins" is rarely the first 
course of action that you want to follow when trying to solve a problem, at 
least in computing. The risk in doing that is, as usual, that the problem is 
not analyzed correctly and some detail is overlooked, or something else.

When I get a suggestion from other people, I could just say "nah, it doesn't 
do what I want" and be done with it. That assumes that everything that 
doesn't tell me exactly how to do "what I want" is rubbish, because I'm sure 
that my approach to the problem is the only right approach, and I know 
exactly that the one I have in mind is the right solution to the problem.

At least for me, I can be 100% sure that that is almost never the case, 
because I'm well aware that my knowledge is limited. This is the reason why 
I rarely dismiss other people's suggestions.

But if it's different for you, then so be it. You have been told, I think 
quite clearly, that "what you want", as you formulated it, is not possible 
in awk or gawk. It can be somehow emulated, and people have shown you some 
different ways to do that. Again, if that is not "what you want" either, 
then expect people to either stop helping you, or asking why it is that you 
still think it's not good. And once you explain your reasons (by citing some 
rant in a forum, which of course may or may not be appropriate to your case, 
unless you wrote it yourself, which you didn't say), I wouldn't find it 
strange that someone comments on it, and (in this specific case) points out 
that what that text says seems to be at least partly contradicting the 
apparent "philosophy" behind what you were trying to do in the first place.

In the future, I would suggest perhaps specifying, as some other regulars 
here and in other groups do, "please don't give me suggestions on how to 
solve my problem in a different way, or workarounds. Please let me know if 
it's possible to do the bloody thing exactly the way I want to do it, or 
shut up. I want to do it my way, and the reason behind that is none of your 
business".

I perfectly understand that point of view, and I for one would surely 
respect your will. Probably other people would, too. But whether that will 
help you "learn new things", then, is an entirely different matter.
0
Reply pk 10/25/2010 3:09:47 PM

pk wrote:

> In the future, I would suggest perhaps specifying, as some other regulars 
> here and in other groups do, "please don't give me suggestions on how to 
> solve my problem in a different way, or workarounds. Please let me know if 
> it's possible to do the bloody thing exactly the way I want to do it, or 
> shut up. I want to do it my way, and the reason behind that is none of your 
> business".

?

Well, I asked for input, you're the one saying 'x' cant be done,
or that 'x' is non-orthdox somehow. More than one way to skin
a cat I'm sure we'd all agree =)

But you know, if I've offended you, please accept my earnest
apoligies. And with that, I'll return to lurk mode, dont want
to upset the dynamic of the group.

Thanks for your's & others insights with gawk pk, have appericated
the help (more than once too) lots of brain food.

-- 
later on,
Mike

http://www.topcat.hypermart.net/index.html
0
Reply mss 10/25/2010 3:41:05 PM

mss wrote:

> pk wrote:
> 
>> In the future, I would suggest perhaps specifying, as some other regulars
>> here and in other groups do, "please don't give me suggestions on how to
>> solve my problem in a different way, or workarounds. Please let me know
>> if it's possible to do the bloody thing exactly the way I want to do it,
>> or shut up. I want to do it my way, and the reason behind that is none of
>> your business".
> 
> ?
> 
> Well, I asked for input, you're the one saying 'x' cant be done,
> or that 'x' is non-orthdox somehow. More than one way to skin
> a cat I'm sure we'd all agree =)
> 
> But you know, if I've offended you, please accept my earnest
> apoligies. And with that, I'll return to lurk mode, dont want
> to upset the dynamic of the group.
> 
> Thanks for your's & others insights with gawk pk, have appericated
> the help (more than once too) lots of brain food.

As I said, no offence given or taken. You sounded like the one who was a bit 
upset, but then I may have misunderstood your tone.
0
Reply pk 10/25/2010 3:54:11 PM

In article <ia46jp$pml$1@speranza.aioe.org>, pk  <pk@pk.invalid> wrote:
....
>In the future, I would suggest perhaps specifying, as some other regulars 
>here and in other groups do, "please don't give me suggestions on how to 
>solve my problem in a different way, or workarounds. Please let me know if 
>it's possible to do the bloody thing exactly the way I want to do it, or 
>shut up. I want to do it my way, and the reason behind that is none of your 
>business".

You wrote a lot of good stuff in this post, but I really like this point.

You expressed well something I've thought for a long time.  I think that
that POV should be the default.  I.e., forget about my actual problem
and just answer the question.  It is unfortunate that the Usenet has
evolved to the point where people always assume the default is the other
one (the "feel free to suggest workarounds and kludges" one.  Also, the
feel free to try to root around and try to figure out what the real
underlying problem is [because if I had wanted to explain the real
underlying problem, I would have done so]).

What it really boils down to is: When I ask a question "How do I do X in
Y?", it is because I am quite happy using Y (i.e., AWK)  - I'm not
interested in using Perl or sed or Ruby or Python or C or assembler or
whatever.  I want to know if there is some feature of AWK that I have
overlooked (that does what I want).  If there isn't some nifty feature
that I just don't know about, then I'm perfectly happy using my own
kludges and workarounds, thank you very much, I don't need yours.

But I really do want to know if there is some feature that I'm just not
aware of.

Finally, speaking to the original thread topic, I want to say a couple
of things:

    1) A million years or so ago, when dinosaurs walked the earth, I
	wrote a program for DOS (in Turbo C) that implemented Unix-style
	"here" documents in DOS batch.  It was rather clever, and allowed
	you to include the data for a program after the program
	invocation in the batch file.  It was developed under DOS 5.x; I
	think it should work under Win95/98, but (not surprisingly...)
	it does not work under NTVDM.

    2) The only real use for this idea (under Unix or DOS or whatever)
	is for "template processing" (also known, to the secretaries of
	the world, as "mail merge").  That is, where the "main data" for
	your script is a template for the desired output; the program
	modifies the template along the way as it is generating the
	output.

-- 
> No, I haven't, that's why I'm asking questions. If you won't help me,
> why don't you just go find your lost manhood elsewhere.

CLC in a nutshell.

0
Reply gazelle 10/25/2010 3:55:52 PM

On 10/25/2010 10:55 AM, Kenny McCormack wrote:
<snip>
> What it really boils down to is: When I ask a question "How do I do X in
> Y?", it is because I am quite happy using Y (i.e., AWK)

I get where you're coming from but SO many times in comp.unix.shell we see "How 
do I do X in sed?" and when asked "why sed?" the answer is almost always, "well, 
it doesn't have to be sed, it's just a tool I thought could do the job" so then 
we give an awk solution and the OP goes away much happier. The same applies for 
grep, bash, etc. values of Y.

So, my experience is that when people ask "How do I do X in Y?" it's usually 
because they just hadn't considered using the much better Z instead, so I think 
it's perfectly reasonable to ignore "in Y" unless the OP explicitly states the 
solution MUST be in Y.

     Ed.
0
Reply Ed 10/25/2010 4:37:52 PM

In article <ia4bp2$lg0$1@news.eternal-september.org>,
Ed Morton  <mortonspam@gmail.com> wrote:
>On 10/25/2010 10:55 AM, Kenny McCormack wrote:
><snip>
>> What it really boils down to is: When I ask a question "How do I do X in
>> Y?", it is because I am quite happy using Y (i.e., AWK)
>
>I get where you're coming from but SO many times in comp.unix.shell we see "How 
>do I do X in sed?" and when asked "why sed?" the answer is almost
>always, "well, 
>it doesn't have to be sed, it's just a tool I thought could do the job" so then 
>we give an awk solution and the OP goes away much happier. The same applies for 
>grep, bash, etc. values of Y.
>
>So, my experience is that when people ask "How do I do X in Y?" it's
>usually because they just hadn't considered using the much better Z
>instead, so I think it's perfectly reasonable to ignore "in Y" unless
>the OP explicitly states the solution MUST be in Y.
>
>     Ed.

You are right, of course.  But that is what I meant about "defaults".

When the Usenet was a community of peers (back when dinosaurs walked the
earth), my default made sense.  Now that there are so many clowns on
here (thank Al Gore for that!), your default is the correct default.

But all of that doesn't stop me from wishing it were otherwise.

-- 
They say compassion is a virtue, but I don't have the time!

    - David Byrne -

0
Reply gazelle 10/25/2010 4:45:52 PM

On Mon, 25 Oct 2010 15:55:52 +0000 (UTC)
gazelle@shell.xmission.com (Kenny McCormack) wrote:

> In article <ia46jp$pml$1@speranza.aioe.org>, pk  <pk@pk.invalid> wrote:
> ...
> >In the future, I would suggest perhaps specifying, as some other
> >regulars here and in other groups do, "please don't give me suggestions
> >on how to solve my problem in a different way, or workarounds. Please
> >let me know if it's possible to do the bloody thing exactly the way I
> >want to do it, or shut up. I want to do it my way, and the reason behind
> >that is none of your business".
> 
> You wrote a lot of good stuff in this post, but I really like this point.
> 
> You expressed well something I've thought for a long time.  I think that
> that POV should be the default.  I.e., forget about my actual problem
> and just answer the question.  It is unfortunate that the Usenet has
> evolved to the point where people always assume the default is the other
> one (the "feel free to suggest workarounds and kludges" one.  Also, the
> feel free to try to root around and try to figure out what the real
> underlying problem is [because if I had wanted to explain the real
> underlying problem, I would have done so]).

Yes, YOU. But experience shows (and the fact that Usenet has evolved in
that direction is perhaps a further proof of it) that many people have
benefited from the approach you dislike. I would say that users like you
are the minority (I can't obviously bring hard facts to support this;
it's just my impression).

> What it really boils down to is: When I ask a question "How do I do X in
> Y?", it is because I am quite happy using Y (i.e., AWK)  - I'm not
> interested in using Perl or sed or Ruby or Python or C or assembler or
> whatever.  

Again yes, YOU are not. Sure. But another person may instead be happy and
thankful because someone showed them an alternative approach, demonstrating
that what the original idea was less fit.

> I want to know if there is some feature of AWK that I have overlooked
> (that does what I want).  If there isn't some nifty feature that I just
> don't know about, then I'm perfectly happy using my own kludges and
> workarounds, thank you very much, I don't need yours.
> 
> But I really do want to know if there is some feature that I'm just not
> aware of.

Saying "just answer my question" is more likely to keep that feature
unknown to you.

What I mean is that I do see your point; however, when reading a post it's
difficult to say whether the requester is asking how to do X because they
really mean that, or because they just don't know any better. Since the
latter seems to be more common, I would suggest that explicitly adding
something to the effect of "I know what I mean" into the message may help
telling the two cases apart.
0
Reply pk 10/25/2010 6:08:15 PM

On 25/10/10 17:09, pk wrote:
> 
> [...] And once you explain your reasons (by citing some
> rant in a forum, which of course may or may not be appropriate to your case, 
> unless you wrote it yourself, which you didn't say), I wouldn't find it 
> strange that someone comments on it, and (in this specific case) points out 
> that what that text says seems to be at least partly contradicting the 
> apparent "philosophy" behind what you were trying to do in the first place.
> [...]

Your posting, and especially above sentence, proved quite impressively that
human brains are unlikely based on neurons, rather must be based on a stack
machine, which is necessary to encode and decode sentences with subordinary
clauses of that amount and depth of nesting. I enjoyed your posting, content
and structure, a lot. Thanks!

Janis
0
Reply Janis 10/25/2010 8:59:14 PM

In article <20101025190815.1ced7df2@scooter.muppet.show>,
pk  <pk@pk.invalid> wrote:
....
>Yes, YOU. But experience shows (and the fact that Usenet has evolved in
>that direction is perhaps a further proof of it) that many people have
>benefited from the approach you dislike. I would say that users like you
>are the minority (I can't obviously bring hard facts to support this;
>it's just my impression).

Please be sure to have read my reply back to Ed, which concedes that, in
terms of the numbers game, you (and Ed) are right.  But as I say there,
it doesn't stop me from wishing the world were otherwise.

And keep in mind that it is a short walk from:

    1) The simple, non-normative and purely descriptive statement that
	"most Xs have property P".
to:
    2) The statement that "we" (the corporate "we") are entitled to
	assume that "all Xs have property P".
to:
    3) The projection that non-P X's are weird and that "we" are entitled
	to marginalize and mock them.

Obviously, the first step is more or less inevitable.
But one must avoid, if at all possible, taking the second step.

-- 
"The anti-regulation business ethos is based on the charmingly naive notion
that people will not do unspeakable things for money." - Dana Carpender

Quoted by Paul Ciszek (pciszek at panix dot com).  But what I want to know
is why is this diet/low-carb food author doing making pithy political/economic
statements?

Nevertheless, the above quote is dead-on, because, the thing is - business
in one breath tells us they don't need to be regulated (which is to say:
that they can morally self-regulate), then in the next breath tells us that
corporations are amoral entities which have no obligations to anyone except
their officers and shareholders, then in the next breath they tell us they
don't need to be regulated (that they can morally self-regulate) ...

0
Reply gazelle 10/25/2010 10:24:29 PM

pk wrote:

> Again yes, YOU are not. Sure. But another person may instead be happy and
> thankful because someone showed them an alternative approach, demonstrating
> that what the original idea was less fit.

I honestly don't understand: in virtually every reply you've
insisted on pronouncing judgment on another, or thinking
your prescribed fix is gospel. What it seems you're railing
against is the very thing your condemning others of - refusing
an alternate point of view. This is somehow very disappointing.

One can not measure idea's worth as 'less than fit' but through
ones own sense of the world...

-- 
later on,
Mike

http://www.topcat.hypermart.net/index.html
0
Reply mss 10/25/2010 11:24:37 PM

Kenny McCormack wrote:

> In article <20101025190815.1ced7df2@scooter.muppet.show>,
> pk  <pk@pk.invalid> wrote:
> ...
>>Yes, YOU. But experience shows (and the fact that Usenet has evolved in
>>that direction is perhaps a further proof of it) that many people have
>>benefited from the approach you dislike. I would say that users like you
>>are the minority (I can't obviously bring hard facts to support this;
>>it's just my impression).
> 
> Please be sure to have read my reply back to Ed, which concedes that, in
> terms of the numbers game, you (and Ed) are right.  But as I say there,
> it doesn't stop me from wishing the world were otherwise.
> 
> And keep in mind that it is a short walk from:
> 
>     1) The simple, non-normative and purely descriptive statement that
> "most Xs have property P".
> to:
>     2) The statement that "we" (the corporate "we") are entitled to
> assume that "all Xs have property P".
> to:
>     3) The projection that non-P X's are weird and that "we" are entitled
> to marginalize and mock them.

In fact, I'm suggesting you (as in "non-P Xs") do something simple to avoid 
being treated like "normal" P Xs.
Since it's usually not possible to tell the difference, the non-P Xs should 
help their readers by doing something to stand out, at which point it would 
be clear that we're dealing with a non-P X and act accordingly (ie, strictly 
answer your question or shut up - at least that's what I'd do).
0
Reply pk 10/26/2010 9:01:04 AM

mss wrote:

> pk wrote:
> 
>> Again yes, YOU are not. Sure. But another person may instead be happy and
>> thankful because someone showed them an alternative approach,
>> demonstrating that what the original idea was less fit.
> 
> I honestly don't understand: in virtually every reply you've
> insisted on pronouncing judgment on another, or thinking
> your prescribed fix is gospel. What it seems you're railing
> against is the very thing your condemning others of - refusing
> an alternate point of view. This is somehow very disappointing.

In fact, I'm probably the only one in the whole thread who didn't make any 
actual suggestion, limiting myself to point out that the feature you wanted 
is available in Perl, and gawk doesn't have it. I had no "prescribed fix", 
because there isn't one.

If you said "I wish awk made coffee" and I replied "awk doesn't do coffee", 
would you call that "refusing an alternate point of view"? I wouldn't. It's 
just a factual statement.

Of course, you can always implement anything you like yourself; and if you 
have a strong use case for it, and convincing reasons about why it would be 
better than another existing way of doing it, I'm pretty sure that most 
maintainers will be happy to discuss it and perhaps include it in their 
implementations.

> One can not measure idea's worth as 'less than fit' but through
> ones own sense of the world...

Agreed.
0
Reply pk 10/26/2010 9:37:41 AM

pk wrote:

> In fact, I'm probably the only one in the whole thread who didn't make any 
> actual suggestion

Riiiight... (I think otherwise honestly) We're very apart on this
issue for the most part pk. But here's how I see it (& attempting
lighten the mood as well):

- What you see: a pesky newbie with outrageous ideas

- What I see: grumpy old grizzle beards

- What you see: someone failing to appreciate hard earned cumulative
  knowledge

- What I see: a very small group of inward looking regulars

- What you see: someone whom dismisses your ideas without a 2nd thought

- What I see: someone whom dismisses my ideas without a 2nd thought

Maybe its a difference of age, or 'computer cultures', or methodologies,
or any number of things, but the two most predominate things I sense are,
your sincerity in wanting to help others tackle a given problem in gawk.
And your frustration when you feel your point has been misunderstood.
I wish you'd sense that on my end too. Really, not much difference from one
person to the next, you & I. I'd rather learn than argue pk & I don't see
any good coming from this thread, wish I had not started it.

Now there's a hard lesson [l]earned for me. =)

-- 
later on,
Mike

http://www.topcat.hypermart.net/index.html
0
Reply mss 10/26/2010 10:28:07 AM

On Tue, 26 Oct 2010 10:28:07 +0000, mss wrote:

> Maybe its a difference of age, or 'computer cultures', or methodologies,
> or any number of things, but the two most predominate things I sense
> are, your sincerity in wanting to help others tackle a given problem in
> gawk. And your frustration when you feel your point has been
> misunderstood. I wish you'd sense that on my end too. Really, not much
> difference from one person to the next, you & I. I'd rather learn than
> argue pk & I don't see any good coming from this thread, wish I had not
> started it.

Perhaps I can cast the problem and paths to its solutions into a form 
that is both new and old.

I call attention to the fact that Unix has long had lex and yacc for the 
purpose of building new languages to solve problems that existing ones 
don't readily solve.  In practice, new languages are usually written in 
old ones - rarely is it necessary to write a new language in itself 
(except for an assembly core).

Your problem can be defined as a task needing a new language in which 
code and data are contained in the same file.  The data are such that 
gawk is a suitable language for their processing.  Gawk is also the 
preferred language in which to write the new one.

Historically, and thinking in terms of interpreted rather than compiled 
languages, this would likely be approached by writing a preprocessor in 
gawk to generate a gawk script and its data from the combined file.  
Fully expanded, this would involve a preprocessor script that created a 
script file and a data file, then shelled the new script in another 
instance of gawk and passed it the data file, but in many cases, the 
target script can have the preprocessor embedded in it by making the 
target script a function that the preporcessor invokes. If done that way, 
the whole thing can be put in a single file.  That is the approach I 
demonstrated.  The implementation might seem new, but conceptually, it's 
thoroughly rooted in long established practice.  I wouldn't be surprised 
if something like it hadn't been done many time before over many years 
and in many languages.

I don't consider your task to be a new problem, nor do I consider my 
solution to be new except in some details.  To reject them is to reject 
long established practice, but to think them new is to ignore long 
established practice.

I am both old and lazy - I long ago found it profitable when tackling a 
new programming task to consider the problem at various levels of 
abstraction until I find an analogy with something I know how to do or 
can find ready solutions I can then abstract and reduce to reality as 
working code without having to invent anything particularly new.  At 
sufficient degrees of abstraction, most new problems are old problems and 
most new solutions are actually old solutions.

Once upon a time, many years ago, I thought I was solving problems in new 
ways, but really wasn't.  Let me give an example: implementing something 
like sprintf() is BASICA.  When I found that BASIC wouldn't let me format 
strings the way PRINT USING would format an output stream, I devised a 
way to get the same result: I used PRINT USING to write the formatted 
stream to a hidden display page, then read it back as a string variable.  
How is that different from formatting in main memory, which is what 
really happens with sprintf()?  It was many years before I realized that 
my implementation wasn't conceptually anything more than what the real 
function would have done if it had existed, just a bit more complicated.

-- 
Ted Davis (tdavis@mst.edu)
0
Reply Ted 10/26/2010 3:19:02 PM

Ted Davis wrote:

> Perhaps I can cast the problem and paths to its solutions into a form 
> that is both new and old.

[...]

Yeah sure enough, good post, some salient points therein...

There's nothing new in the idea of parsing embedded data, & I got a chuckle
when I was accused of making awk do 'strange things', & I sure will! If it
can be done, that's justification enough that an idea is possible. No
blinders for me thank you =) Now something like reinventing the wheel in a
production environment would be foolish, however, when brain-storming for
the simple *enjoyment of itself, I submit: why not? In my mind this amounts
to a blending (just as you noted) of new & old, or more precisely:

looking at old problems in new ways

Sometimes folks can become so attached to something, or a certain way of
thinking, that anything outside of the status quo is intimidating or
confusing, I'm sure we've all felt this at one time or another. For me its
about applying my knowledge across multiple environments, and gawk is superb
for that. Lots of sharp folks around here, I just have to learn their ways
it seems.

* a rare beast not often found in these badlands

-- 
later on,
Mike

http://www.topcat.hypermart.net/index.html
0
Reply mss 10/26/2010 4:04:17 PM

On 10/26/2010 11:04 AM, mss wrote:
> Ted Davis wrote:
>
>> Perhaps I can cast the problem and paths to its solutions into a form
>> that is both new and old.
>
> [...]
>
> Yeah sure enough, good post, some salient points therein...
>
> There's nothing new in the idea of parsing embedded data,&  I got a chuckle
> when I was accused of making awk do 'strange things',&  I sure will! If it
> can be done, that's justification enough that an idea is possible. No
> blinders for me thank you =) Now something like reinventing the wheel in a
> production environment would be foolish, however, when brain-storming for
> the simple *enjoyment of itself, I submit: why not? In my mind this amounts
> to a blending (just as you noted) of new&  old, or more precisely:
>
> looking at old problems in new ways
>
> Sometimes folks can become so attached to something, or a certain way of
> thinking, that anything outside of the status quo is intimidating or
> confusing, I'm sure we've all felt this at one time or another. For me its
> about applying my knowledge across multiple environments, and gawk is superb
> for that. Lots of sharp folks around here, I just have to learn their ways
> it seems.
>
> * a rare beast not often found in these badlands
>

I think you're reading too much into this thread. You asked how to do something 
that several people thought was a bad idea so they told you that. That's all.

	Ed.
0
Reply Ed 10/26/2010 8:59:52 PM

Ed Morton wrote:

> I think you're reading too much into this thread. You asked how to do something 
> that several people thought was a bad idea so they told you that. That's all.

Well, I'll take you at face value Ed, its all very confusing
to me as to what's permissible to ask or not as I thought it
was very much about gawk (usenet newbie). Certainly didn't see
pk's really mad sounding words a few posts back in this thread
coming or intend to get anyone worked up, it really caught me
off guard. Seems its the norm to be wary in the newsgroups as
I'm learning. :/ Really, just wanted to 'talk gawk' a learn &
trick or two. Its no biggie though. Well, back to reading for me.

-- 
later on,
Mike

http://www.topcat.hypermart.net/index.html
0
Reply mss 10/26/2010 11:22:59 PM

On Tue, 26 Oct 2010 15:59:52 -0500, Ed Morton wrote:

> I think you're reading too much into this thread. You asked how to do
> something that several people thought was a bad idea so they told you
> that. That's all.

It's usually a bad idea, but "usually" is not "always".  Not everybody 
grasps that right away.  I'd have to know the details before I could say 
whether is is a good idea or a bad one in this particular case.  I can't 
think of a case where it would be a particularly good idea, but I'm sure 
there must be one somewhere, somewhen.  I can think of a couple of cases 
where it might not be totally bad, but I probably wouldn't do it anyway.

Larval programmers have to experiment to learn.  I think we all probably 
did, and sometimes still do.

-- 
Ted Davis (tdavis@mst.edu)
0
Reply Ted 10/26/2010 11:47:26 PM

Ted Davis wrote:

> It's usually a bad idea, but "usually" is not "always".  Not everybody 
> grasps that right away.  I'd have to know the details before I could say 
> whether is is a good idea or a bad one in this particular case.  I can't 
> think of a case where it would be a particularly good idea, but I'm sure 
> there must be one somewhere, somewhen.  I can think of a couple of cases 
> where it might not be totally bad, but I probably wouldn't do it anyway.
>
> Larval programmers have to experiment to learn.  I think we all probably 
> did, and sometimes still do.

Larval? Really? Good grief Ted, Dawkins would be proud of this meme.
'In the tribe of chimpanzees I'm just a monkey' - Beck

There are so many levels of social stratification resonating in
your post the mind boggles. Its was just an idea, a vehicle to
learn more about gawk, to engage others that's all - ugh...

I gotta take a break.

-- 
later on,
Mike

http://www.topcat.hypermart.net/index.html
0
Reply mss 10/27/2010 7:34:02 AM

On Wed, 27 Oct 2010 07:34:02 +0000, mss wrote:

> Ted Davis wrote:
> 
>> It's usually a bad idea, but "usually" is not "always".  Not everybody
>> grasps that right away.  I'd have to know the details before I could
>> say whether is is a good idea or a bad one in this particular case.  I
>> can't think of a case where it would be a particularly good idea, but
>> I'm sure there must be one somewhere, somewhen.  I can think of a
>> couple of cases where it might not be totally bad, but I probably
>> wouldn't do it anyway.
>>
>> Larval programmers have to experiment to learn.  I think we all
>> probably did, and sometimes still do.
> 
> Larval? Really? Good grief Ted, Dawkins would be proud of this meme. 'In
> the tribe of chimpanzees I'm just a monkey' - Beck

"larval stage: n.

    Describes a period of monomaniacal concentration on coding apparently 
passed through by all fledgling hackers. Common symptoms include the 
perpetration of more than one 36-hour hacking run in a given week; 
neglect of all other activities including usual basics like food, sleep, 
and personal hygiene; and a chronic case of advanced bleary-eye. Can last 
from 6 months to 2 years, the apparent median being around 18 months. A 
few so afflicted never resume a more ‘normal’ life, but the ordeal seems 
to be necessary to produce really wizardly (as opposed to merely 
competent) programmers. See also wannabee. A less protracted and intense 
version of larval stage (typically lasting about a month) may recur when 
one is learning a new OS or programming language." - The Jargon File

I figured you are past the wannabe stage.

> 
> There are so many levels of social stratification resonating in your
> post the mind boggles. Its was just an idea, a vehicle to learn more
> about gawk, to engage others that's all - ugh...

I don't recognize social stratification, but I do recognize skill levels 
and development stages.  You *are* learning about gawk, and also about 
programming general ... and about dealing with sometimes touchy senior 
level programmers.  In many cases, the most advanced programmers are also 
among the most tolerant, but I also think we all have our buttons.  One 
important thing to learn is who has which buttons so you can avoid 
accidentally pushing them.  For example, there are people who don't like 
gawk under Windows (I don't either, but I do it and deal with it, so it 
isn't a button for me).


-- 
Ted Davis (tdavis@mst.edu)
0
Reply Ted 10/27/2010 1:39:39 PM

In article <8iqocrFjs5U1@mid.individual.net>,
Ted Davis  <tdavis@mst.edu> wrote:
....
>> Larval? Really? Good grief Ted, Dawkins would be proud of this meme. 'In
>> the tribe of chimpanzees I'm just a monkey' - Beck
>
>"larval stage: n.

You're not helping your case any.

As they say, when you find yourself in a hole, the first you do is to
stop digging.

-- 
Religion is regarded by the common people as true,
	by the wise as foolish,
	and by the rulers as useful.

(Seneca the Younger, 65 AD)

0
Reply gazelle 10/27/2010 1:43:19 PM

On 10/27/2010 8:43 AM, Kenny McCormack wrote:
> In article<8iqocrFjs5U1@mid.individual.net>,
> Ted Davis<tdavis@mst.edu>  wrote:
> ...
>>> Larval? Really? Good grief Ted, Dawkins would be proud of this meme. 'In
>>> the tribe of chimpanzees I'm just a monkey' - Beck
>>
>> "larval stage: n.
>
> You're not helping your case any.
>
> As they say, when you find yourself in a hole, the first you do is to
> stop digging.
>

That may be the first posting I've seen in this thread that hasn't made me go 
"Huh???".

	Ed.
0
Reply Ed 10/27/2010 2:53:52 PM

Wed, 27 Oct 2010 09:53:52 -0500, Ed Morton did cat :

> On 10/27/2010 8:43 AM, Kenny McCormack wrote:
>> In article<8iqocrFjs5U1@mid.individual.net>, Ted Davis<tdavis@mst.edu> 
>> wrote:
>> ...
>>>> Larval? Really? Good grief Ted, Dawkins would be proud of this meme.
>>>> 'In the tribe of chimpanzees I'm just a monkey' - Beck
>>>
>>> "larval stage: n.
>>
>> You're not helping your case any.
>>
>> As they say, when you find yourself in a hole, the first you do is to
>> stop digging.
>>
>>
> That may be the first posting I've seen in this thread that hasn't made
> me go "Huh???".

quite so, though i'm still tossing a three faced coin to try and have a choice if
that was incorrectly replying to Ted or not or none of the above ;-)

now waiting for the next algorithm search for the thricely paired coin module in mss tooyools...
0
Reply Loki 10/27/2010 6:40:55 PM

In article <pan.2010.10.27.18.40.53@thedarkdesign.free.fr.INVALID>,
>> On 10/27/2010 8:43 AM, Kenny McCormack wrote:
>>> In article<8iqocrFjs5U1@mid.individual.net>, Ted Davis<tdavis@mst.edu> 
>>> wrote:
>>> ...
>>>>> Larval? Really? Good grief Ted, Dawkins would be proud of this meme.
>>>>> 'In the tribe of chimpanzees I'm just a monkey' - Beck
>>>>
>>>> "larval stage: n.
>>>
>>> You're not helping your case any.
>>>
>>> As they say, when you find yourself in a hole, the first you do is to
>>> stop digging.
>>>
>>>
>> That may be the first posting I've seen in this thread that hasn't made
>> me go "Huh???".

I'm sympathetic to mss's position.  Though *I* understand the cleverness
of Ted's use of the word "Larval" (because, after all, for us cool
people, anything in the jargon file is, ipso facto, cool), I also see it
as a sleazy insult and it's a little hard to avoid it being taken as such.

So, I think it was a little scummy of Ted to use it - and then use it
again, w/o really explaining *why* it is cool (and, by extension, why
mss should suck it up and become a cool person too).

-- 
But the Bush apologists hope that you won't remember all that. And they
also have a theory, which I've been hearing more and more - namely,
that President Obama, though not yet in office or even elected, caused the
2008 slump. You see, people were worried in advance about his future
policies, and that's what caused the economy to tank. Seriously.

    (Paul Krugman - Addicted to Bush)

0
Reply gazelle 10/27/2010 7:30:50 PM

On Wed, 27 Oct 2010 19:30:50 +0000, Kenny McCormack wrote:

> In article <pan.2010.10.27.18.40.53@thedarkdesign.free.fr.INVALID>,
>>> On 10/27/2010 8:43 AM, Kenny McCormack wrote:
>>>> In article<8iqocrFjs5U1@mid.individual.net>, Ted
>>>> Davis<tdavis@mst.edu> wrote:
>>>> ...
>>>>>> Larval? Really? Good grief Ted, Dawkins would be proud of this
>>>>>> meme. 'In the tribe of chimpanzees I'm just a monkey' - Beck
>>>>>
>>>>> "larval stage: n.
>>>>
>>>> You're not helping your case any.
>>>>
>>>> As they say, when you find yourself in a hole, the first you do is to
>>>> stop digging.
>>>>
>>>>
>>> That may be the first posting I've seen in this thread that hasn't
>>> made me go "Huh???".
> 
> I'm sympathetic to mss's position.  Though *I* understand the cleverness
> of Ted's use of the word "Larval" (because, after all, for us cool
> people, anything in the jargon file is, ipso facto, cool), I also see it
> as a sleazy insult and it's a little hard to avoid it being taken as
> such.
> 
> So, I think it was a little scummy of Ted to use it - and then use it
> again, w/o really explaining *why* it is cool (and, by extension, why
> mss should suck it up and become a cool person too).

That is a misunderstanding of both the definition and my meaning.  It is 
not an insult to promote someone from wannabe to larval stage.  Instead, 
it is a recognition of promise.  I look back fondly on my larval stage, 
though the only reason I had the time was because I was out of work for 
nearly a year and spent all my free time banging away in C and C++.

-- 
Ted Davis (tdavis@mst.edu)
0
Reply Ted 10/27/2010 11:35:38 PM

Ted Davis wrote:

> That is a misunderstanding of both the definition and my meaning.  It is 
> not an insult to promote someone from wannabe to larval stage.  Instead, 
> it is a recognition of promise.  I look back fondly on my larval stage, 
> though the only reason I had the time was because I was out of work for 
> nearly a year and spent all my free time banging away in C and C++.

Guys - get off this thread & forget about it, I've unwittingly
created a monstrosity that fscks with the fabric of time & space...

And yes I've read the jargon file before (hint: meme was just
a cynical observation).

-- 
later on,
Mike

http://www.topcat.hypermart.net/index.html
0
Reply mss 10/28/2010 12:36:36 AM

> I have an idea, dont know yet if it would work, but imagine:
> An awk script with the data appended to it.
> - let 'EOF' be the division between the script & data
> - let everything above 'EOF' be the script
> - let everything below 'EOF' be the 'datascape'

RunAWK

    http://sf.net/projects/runawk

provides this functionality. See below.
An example script contains two data: data1 and data2, enclosed in
..begin-str/.end-str sections. '#use embed_str.awk' directive
analyses these sections and automatically fills EMBED_STR array.

   0 cheusov>cat /home/cheusov/tmp/11.awk
   #!/usr/bin/env runawk

   #use "embed_str.awk"

   #.begin-str data1
   # line_1_1
   # line_1_2
   # ...
   # line_1_N1
   #.end-str

   #.begin-str data2
   # line_2_1
   # line_2_2
   # ...
   # line_2_N2
   #.end-str

   BEGIN {
        print "                    data1 is..."
        print EMBED_STR ["data1"]

        print "                    data2 is..."
        print EMBED_STR ["data2"]

        exitnow(0)
   }

   0 cheusov>/home/cheusov/tmp/11.awk 
                       data1 is...
   line_1_1
   line_1_2
   ...
   line_1_N1
                       data2 is...
   line_2_1
   line_2_2
   ...
   line_2_N2

   0 cheusov>

-- 
Best regards, Aleksey Cheusov.
0
Reply Aleksey 10/28/2010 8:46:14 PM

Aleksey Cheusov wrote:

> RunAWK
>
>     http://sf.net/projects/runawk
>
> provides this functionality. See below.

[...]

Thank you Aleksey, I appreciate your help,
I'll take a look at RunAWK. 

-- 
later on,
Mike

http://www.topcat.hypermart.net/index.html
0
Reply mss 10/28/2010 11:01:20 PM

54 Replies
133 Views

(page loaded in 0.337 seconds)

6/10/2013 5:53:19 AM


Reply: