Volume 3 Issue 7, July 2004 Node.pm |
Copyright (C) 2004 by Steve Litt. All rights reserved. Materials from guest authors copyrighted by them and licensed for perpetual use to Linux Productivity Magazine. All rights reserved to the copyright holder, except for items specifically marked otherwise (certain free software source code, GNU/GPL, etc.). All material herein provided "As-Is". User assumes all risk and responsibility for any outcome.
|
and Rapid Learning: Secret Weapon of the Successful Technologist by Steve Litt |
[ Troubleshooters.Com
| Back Issues |Troubleshooting Professional Magazine
]
-- Thomas Carlyle |
CONTENTS
What is UMENU?
UMENU is a keyboard driven menu program that accepts user keystrokes, and in response invokes either submenus or programs. It runs on any Linux or Unix computer, and can substitute for the desktop manager's menu. It can also serve as the front end for commands with numerous options. Crafted for the touch typist, only a single keystroke is required to trigger a submenu or program. It is not necessary to press the Enter key. UMENU runs from a group of menu definition files, all ending in .mnu, each of which defines a single submenu and everything on it. The reason it was decided to have one file run one menu, instead of a single file defining the entire menu hierarchy, is because small files load fast relative to human keystrokes, so the user perceives no delay. The trouble with the file per submenu paradigm is that it's cumbersome to author. To eliminate that disadvantage, EMDL (Easy Menu Definition Language), and an EMDL to UMENU converter, were created. Now an entire menu system can be created and maintained as a single tab indented outline file, which can then be compiled into performance enhancing UMENU files. |
# TOP |
News Mag |
Submission URL or
Email
address |
Comments |
Slashdot |
http://slashdot.org/submit.pl |
Just fill in the short form. |
LinuxToday |
http://linuxtoday.com/contribute.php3 |
Just fill in the short form. |
Linux Weekly News |
lwn@lwn.net |
Just tell them the URL, why you like it. |
NewsForge |
webmaster@linux.com |
Just tell them the URL, why you like it. |
VarLinux |
http://www.varlinux.org/vlox/html/modules/news/submit.php |
Just fill in the short form. |
LinuxInsider.Com, Newsfactor Network |
http://www.newsfactor.com/perl/contact_form.pl?to=contact |
Just tell them the URL, why you like it. |
The Linux Knowledge Portal |
webmaster@linux-knowledge-portal.org |
Just tell them the URL, why you like it. |
OS News |
http://www.osnews.com/submit.php |
Just tell them the URL, why you like it. |
DesktopLinux |
http://www.desktoplinux.com/cgi-bin/news_post.cgi |
Only for LPM issues involving the Linux desktop,
not
for programming or server issues. |
"GNU/Linux" is probably the most accurate moniker one can give to this operating system. Please be aware that in all of Troubleshooters.Com, when I say "Linux" I really mean "GNU/Linux". I completely believe that without the GNU project, without the GNU Manifesto and the GNU/GPL license it spawned, the operating system the press calls "Linux" never would have happened.
I'm part of the press and there are times when it's easier to say "Linux" than explain to certain audiences that "GNU/Linux" is the same as what the press calls "Linux". So I abbreviate. Additionally, I abbreviate in the same way one might abbreviate the name of a multi-partner law firm. But make no mistake about it. In any article in Troubleshooting Professional Magazine, in the whole of Troubleshooters.Com, and even in the technical books I write, when I say "Linux", I mean "GNU/Linux".
There are those who think FSF is making too big a deal of this.
Nothing
could be farther from the truth. The GNU General Public License,
combined
with Richard Stallman's GNU Manifesto and the resulting GNU-GPL
License,
are the only reason we can enjoy this wonderful alternative to
proprietary
operating systems, and the only reason proprietary operating systems
aren't
even more flaky than they are now.
For practical purposes, the license requirements of "free software" and
"open
source" are almost identical. Generally speaking, a license that
complies
with one complies with the other. The difference between these two is a
difference
in philosophy. The "free software" crowd believes the most important
aspect
is freedom. The "open source" crowd believes the most important aspect
is
the practical marketplace advantage that freedom produces.
I think they're both right. I wouldn't use the software without the
freedom
guaranteeing me the right to improve the software, and the guarantee
that
my improvements will not later be withheld from me. Freedom is
essential.
And so are the practical benefits. Because tens of thousands of
programmers
feel the way I do, huge amounts of free software/open source is
available,
and its quality exceeds that of most proprietary software.
In summary, I use the terms "Linux" and "GNU/Linux" interchangably,
with
the former being an abbreviation for the latter. I usually use the
terms
"free software" and "open source" interchangably, as from a licensing
perspective
they're very similar. Occasionally I'll prefer one or the other
depending
if I'm writing about freedom, or business advantage.
[slitt@mydesk Node]$ ./example_hello.pl |
#!/usr/bin/perl -w |
[slitt@mydesk slitt]$ ./hello.pl |
#!/bin/sh |
[slitt@mydesk slitt]$ ./run hello.pl |
my $callbacks = Callbacks->new();However, there's nothing to stop a Callback object's new() method from instantiating variables or performing other functions.
# TOP |
package Callbacks; |
#!/usr/bin/perl -w |
./run test.pl | less |
#!/usr/bin/perl -w |
./run test.pl | less |
my $walker = Walker->new |
#!/usr/bin/perl -w |
[slitt@mydesk slitt]$ ./run test.pl | head -n20 |
#!/usr/bin/perl -w |
./run ./test.pl | head -n70 |
[slitt@mydesk slitt]$ cat Node/deletetest.otl |
[slitt@mydesk slitt]$ ./run ./test.pl |
#!/usr/bin/perl -w |
$currNode->insertFirstChild(Node->new("myName", "myType", "myValue"));There's a Node::insertLastChild() that does the same, except inserts the node as the last child.
$currNode->insertSiblingAfterYou(Node->new("myName", "myType", "myValue"));This single call does the following:
#!/usr/bin/perl -w |
./run ./test.pl | less
for(my $n=8; $n <= 16; $n++) |
$juneNode = $juneNode->getFirstChild(); |
sub cbMakeMarks()
|
my $newNode = Node->new("myName", "myType", "myValue);Or the precreation can be nested into the argument itself:
my $newSibling = $currNode->insertSiblingAfterYou($newNode);
my $newSibling = $currNode->insertSiblingAfterYou(Node->new("myName", "myType", "myValue));This article demonstrated several riffs commonly used by Node.pm programmers:
use Node;Typically all directories on the Perl module path are writeable only by root, so this alternative works only if you have root access on the box.
#!/usr/bin/perl -w |
[slitt@mydesk slitt]$ ./test.pl |
#!/bin/sh |
#!/usr/bin/perl -w |
nodedir=/data/perl/Nodethen you can run the program without a shellscript:
[slitt@mydesk slitt]$ ./test.pl |
package Node |
|
package OutlineParser |
|
package Walker |
|
#!/usr/bin/perl -w |
# 12 |
Montgomery Richardson Washington Anderson Osbourne Peterson Ethridge Zelinski Douglas Jackson Gardner Quigley Stevens Thomas Yamaha Ibenez Victor Xavier Heller Barnes Ullman Carter Farber Louis Kelly Nagle |
#!/usr/bin/perl -w |
# 12 |
Any article submitted to Linux Productivity Magazine must be licensed with the Open Publication License, which you can view at http://opencontent.org/openpub/. At your option you may elect the option to prohibit substantive modifications. However, in order to publish your article in Linux Productivity Magazine, you must decline the option to prohibit commercial use, because Linux Productivity Magazine is a commercial publication.
Obviously, you must be the copyright holder and must be legally able to so license the article. We do not currently pay for articles.
Troubleshooters.Com reserves the right to edit any submission for clarity or brevity, within the scope of the Open Publication License. If you elect to prohibit substantive modifications, we may elect to place editors notes outside of your material, or reject the submission, or send it back for modification. Any published article will include a two sentence description of the author, a hypertext link to his or her email, and a phone number if desired. Upon request, we will include a hypertext link, at the end of the magazine issue, to the author's website, providing that website meets the Troubleshooters.Com criteria for links and that the author's website first links to Troubleshooters.Com. Authors: please understand we can't place hyperlinks inside articles. If we did, only the first article would be read, and we can't place every article first.
Submissions should be emailed to Steve Litt's email address, with subject line Article Submission. The first paragraph of your message should read as follows (unless other arrangements are previously made in writing):
Copyright (c) 2003 by <your name>. This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, version Draft v1.0, 8 June 1999 (Available at http://www.troubleshooters.com/openpub04.txt/ (wordwrapped for readability at http://www.troubleshooters.com/openpub04_wrapped.txt). The latest version is presently available at http://www.opencontent.org/openpub/).
Open Publication License Option A [ is | is not] elected, so this document [may | may not] be modified. Option B is not elected, so this material may be published for commercial purposes.
After that paragraph, write the title, text of the article, and a two sentence description of the author.