LINK="#3366FF" VLINK="#A000A0">


[ Table of Contents ][ Front Page ][ FAQ ][ Next ]

The Mailbag



HELP WANTED : Article Ideas

Send tech-support questions, answers and article ideas to The Answer Gang <tag@lists.linuxgazette.net>. Other mail (including questions or comments about the Gazette itself) should go to <gazette@linuxgazette.net>. 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 ...

Bryan Anderson wrote an article in August 2001 Linux Gazette titled 'Make your Virtual Console Log In Automatically'.

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.

Thu, 2 Aug 2001 16:39:28 -0700
brad harder (bharder from methodlogic.net)

I'd be interested to read what Bryan has to say about this subject ...

-bch

Thu, 16 Aug 2001 13:27:50 +0200
Yann Droneaud (ydroneaud from meuh.eu.org)

Hi,

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).

-- Yann Droneaud


Portals

Tue, 14 Aug 2001 22:44:16 -0500
Vic Ward (vward from uswest.net)

What combination of open source software should be used to create a portal site? How could a beginner build and test such a site?

A handful of the Answer Gang are just starting to give him links to some related software, but an article from someone out there who has already had the experience would be even better.


Migrating to SAGU

Wed, 22 Aug 2001 02:11:23 -0300 (EST)
Cesar Brod (cesar from brod.com.br)

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@linuxgazette.net.

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!


GENERAL MAIL



Re: Mistake

Thu, 2 Aug 2001 10:12:54 -0700
Michael P. Plezbert and Xavier Prat

This is an exchange regarding CUP


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 :

ex.

precedence left MINUS, PLUS; precedence left TIMES, DIVIDE;

and

expr ::= term
       |  expr  MINUS expr
       |  expr  PLUS  expr
       |  expr   TIMES expr
       |  expr  DIVIDE expr

We needed a bit more clarity, originally we weren't sure what he was replying to:

Generally the examples given along with developement packages or with teaching-manuals, should be merely considered as simple hints and if used 'as-is', extreme care should be taken ...

In the case of modern LALR parser generators with the feature of precedence-directives :

  1. the factor-type productions often present in examples (in grammars with expression-productions), are error prone and uselessly over-clobber grammars.
  2. thus factor-type productions should simply be left out so that precedence rules can work freely as expected.

Enjoy
Waldemar


Thank you everyone

Fri, 10 Aug 2001 13:39:29 -0700
Lindsey Seaton (hetshepsut from yahoo.com)

On Fri, Aug 10, 2001 at 01:34:54PM -0700, Lindsey Seaton wrote:

Thank you everyone who helped to answer my question. The web page that was linked in one of the e-mails was very helpful and added to my "favorites" list for future referance.

Thanks for letting us know. And when you know a bit more about Linux and are able to answer this question for somebody else, please do so. That's what keeps the Linux community active.


Learning Perl, part 5 (LG #69)

Sat, 25 Aug 2001 13:11:48 -0400
Paulo Jorge (paulojjs from yahoo.com)
Reply from Ben Okopnik

I was reading your article in the Linux Gazette about programming perl and I have a little problem in a simple script. This is the script that should open /var/log/messages and search for some text:

#!/usr/bin/perl -w
use strict

open(MESS, "</var/log/messages") or die "Cannot open file: $!\n";
while(<MESS>) {
    print "$_\n" if /(fail|terminat(ed|ing)|no)/i;
}
close MESS;

when I run the script the result is the following:

$ ./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

Mon, 27 Aug 2001 08:39:07 +0000
Walt Stoneburner (wls from wwco.com)

Hey,

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

Wed, 29 Aug 2001 11:40:54 -0700
Mike Orr (LG Editor)

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".

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.


This page edited and maintained by the Editors of Linux Gazette Copyright © 2001
Published in issue 70 of Linux Gazette September 2001
HTML script maintained by Heather Stern of Starshine Technical Services, http://www.starshine.org/


[ Table of Contents ][ Front Page ][ FAQ ][ Next ]