HELP WANTED : Article Ideas

Send tech-support questions, answers and article ideas to The Answer Gang
<linux-questions-only@ssc.com>. Other mail (including
questions or comments about the Gazette itself) should go to
<gazette@ssc.com>. All material
sent to either of these addresses will be considered for publication in the
next issue. Please send answers to the original querent too, so that s/he
can get the answer without waiting for the next issue.

Unanswered questions might appear here. Questions with
answers -- or answers only -- appear in The Answer Gang, 2-Cent Tips, or here,
depending on their content. There is no guarantee that questions will
ever be answered, especially if not related to Linux.

Before asking a question, please check the
Linux Gazette FAQ to see if it has been
answered there.

Arcane information ...

Many years ago, before the Web when terminals mattered a lot more, I
spent many hours combing through kernel code and experimenting to
figure out process groups, sessions, controlling terminals, job
control, SIGINT, SIGHUP, and the like. I could write a long article on
it, but I think it's really arcane information.

I read the article written by Bryan Anderson in August 2001 Linux
Gazette titled 'Make your Virtual Console Log In Automatically'. The
last section about process groups and controlling terminal was too short
for me.

I would be happy if Bryan could write a technical article about this
subject as it's suggested by him and the editor.
I'm wondering his knowledge could help me.

PS: my currently knowledge is based on a approxmilty reading of bash
source code and the GNU libc manual (info).

Migrating to SAGU

I work as technology consultant for a small University Centre in the South
of Brazil ... we have migrated all of our academic/administrative system
into Free Software, developing the SAGU system.

BTW, I am a guest speaker at the Annual Linux Showcase, where I will be
presenting our SAGU system.

Well, let me know if you like the idea and I will produce an article.

Thanks, Cesar, we'd love to see your article. It falls solidly into
the "real life experiences" category defined in our
author guidelines. You should look there for the
upcoming deadlines, and submit to
gazette@ssc.com.

You may find also interesting we host a "Source Forge" site at
"http://codigoaberto.org.br"
where we have more than 80 hosted projects, from people all over Brazil.

Cesar Brod
Univates/Brod Tecnologia

Gentle Readers: If you have broad reaching projects that you
think make Linux fun and more useful, we encourage you to
consider submitting an arttcle too!

Michael has taught the compiler course at Washington Univeersity, and
programming languages is one of his areas of study.

On Thu, 28 Jun 2001 18:16:59 +0100 Xavier wrote:

I just look at your issue 41 (I know that is not really recent ...) but
in the article of Christopher Lopes which is talking about CUP, there is
a mistake...

I tested it and I see that it didn't walk correctly for all the cases. In
fact it is necessary to put a greater priority to the operator ' - ' if
not, we have 8-6+9 = -7 because your parsor realizes initially (6+9 = 15)
and after (8-15= -7). To solve this problem it is enough to create a
state between expr and factor which will represent the fact that the
operator - has priority than it +.

Cordially.
Xavier Prat.

On Wed, Aug 01, 2001 at 05:56:21PM -0500, Michael P. Plezbert wrote:

I just couldn't let this slip by.

You do NOT want to give the minus operator a greater priority than the
plus operator, because then expressions like a+b-c would parse as a+(b-c),
which generally is not what you want. (Algebraically, plus and minus are
usually given the same priority, so a+b-c means (a+b)-c.)

In fact, giving the minus operator a higher priority in the CUP file
(using CUP's priority capability) will not change anything given the
grammar as written in the original article, since the grammar is
unambiguous with regard to plus and minus.

The problem is that the lines in the grammar

expr ::= factor PLUS expr
| factor MINUS expr

cause the plus and minus operators to be right-associative, when we want
them to be left-associative.

The fix is to changes the lines to be

expr ::= expr PLUS factor
| expr MINUS factor

This will make the grammar associate the plus and minus operators in the
usual way.

(This may have been what the author of the previous mail meant, but the
text was unclear and the link to the CUP file was broken.)

Michael

That broken link had been my fault (sorry) but it was fixed immediately
when you let us know. Thanks! -- Heather

Michael is right...
The fix is just to transform the rules of expr for PLUS and MINUS become
left-associative. Thing which I had made in my preceding fix, but it's true
that to give a higher priority to MINUS is, in fact, totaly useless...

thanks.
Xavier PRAT.

Re: Mistake ...

Fri, 10 Aug 2001 08:40:29 -0700
Waldemar Olenycz

Eh folks !!

Why don't you just remove all the factor productions (which is
clearly school boy junk ...)
and leave nothing between <expressions> and <terms> so that the
precedence directives
can work freely, and there will be no problem :

$ ./logs.pl
syntax error at ./logs.pl line 4, near ") or"
Execution of ./logs.pl aborted due to compilation errors.

Do you have a clue about what's going on?

I have a RedHat Linux with perl 5.6.0

I believe I've actually mentioned this type of error in one of the
articles. It's a very deceptive one... and yet shared by all languages
that ignore whitespace, due to the way the parser has to look at the
code.

Look at line 4 carefully. Look at it again. Can't find anything wrong?
That's because there isn't anything. Instead, take a look at the
previous line of code, line 2 - it's missing a semicolon at the end!
When that happens, Perl figures that you simply continued your statement
further down - so, what it sees is

use strict open(MESS, "</var/log/messages")

at which point it realizes "Uh-oh. We've gone past anything that looks
like valid syntax for the 'use' function - PANIC TIME!"

The lack of a terminator on a previous line is always an error on the
current line.

Learning Perl: thank you

Just wanted to drop a quick line and say thank you for your Learning
Perl series in Linux Gazette. I very much enjoyed your writing style,
technical depth, and approach ... I picked up a lot of useful tips, and
I've been using Perl for quite a while.

Keep up the excellent work.

--
Walt Stoneburner

GAZETTE MATTERS

Mirror searches

Per the request of one of our mirrors in Germany, I have added a
provision for our mirror sites who want to run their own search
engine. Starting with this issue, the Search link on the home page
and the TOC page has changed from "Search" to "Search (www.linuxgazette.com)".

Mirrors with their own search engine may replace the text between

<!-- *** BEGIN mirror site search link *** -->

and

<!-- *** END mirror site search link *** -->

with a link to "(SITE.COM mirror)" on the TOC page, and
"Search (SITE.COM mirror)" on the home page.