Discussion:
terseness & menues
(too old to reply)
n***@gmail.com
2015-10-17 17:07:12 UTC
Permalink
I'm writing in LEO now, and the menu/matrix needs fixed-width-font.

Here's a little example re. criticising Oberon's english full-words,
instead of abreviations. The *code* below : of 4 lines, has 2 lines
to try to explain that/how it produces the test-case below that.

And it also shows the power of menues, as ETHO has acknowledged.

And it relates to higher-level functions, in that
PROCEDURE Mx(RowColm(4,6): Text , <other args>): RetType;
might be way of passing the argument: "/mnt/ReiseBrdg"

#!/bin/sh
# Show RowColm numbered MatrixMenu to select Row, Colum: entry.
# add line-no & show some fields of 'df'
df | awk '{print NR " " $0}' | more
echo " 1 2 3 4 5 6"
read -p "ROW/ COLM =" ROW COLM

df |head -$ROW |tail -1 | awk -v n=$COLM '{print $n}'

exit 0

==> test result output: first show the matrix/menu; them prompt & read Row,Colum:--
~:RowColm
1 Filesystem 1K-blocks Used Available Use% Mounted on
2 /dev/root 7692876 7040288 261812 97% /
3 tmpfs 968028 0 968028 0% /dev/shm
4 /dev/hda16 3903620 2223872 1679748 57% /mnt/ReiseBrdg
5 /dev/hda6 2071384 1750000 216160 90% /mnt/hdc6
6 /dev/hda11 980308 782068 148444 85% /mnt/hdc11
7 /dev/hda14 7692876 5652268 1649832 78% /mnt/FC1
8 /dev/hda17 14421344 6618584 7070200 49% /mnt/DebDVD1bak
9 /dev/sdb1 4182016 3508840 673176 84% /mnt/ZTE
1 2 3 4 5 6
ROW/ COLM =8 6
/mnt/DebDVD1bak
------------------------- end of test result output.
Terseness only suits you if/when YOU understand it.
Pascal J. Bourguignon
2015-10-17 19:24:17 UTC
Permalink
Post by n***@gmail.com
I'm writing in LEO now,
What are you doing in Low Earth Orbit?
Also, I've always wondered, isn't it a little difficult to use a
keyboard in freefall? (Well here down on Earth I prefer mechanical
keyboard. I supposer laptop keyboards or tablet virtual keyboards
wouldn't be so hard to use in freefall).
Post by n***@gmail.com
and the menu/matrix needs fixed-width-font.
Here's a little example re. criticising Oberon's english full-words,
instead of abreviations. The *code* below : of 4 lines, has 2 lines
to try to explain that/how it produces the test-case below that.
And it also shows the power of menues, as ETHO has acknowledged.
And it relates to higher-level functions, in that
PROCEDURE Mx(RowColm(4,6): Text , <other args>): RetType;
might be way of passing the argument: "/mnt/ReiseBrdg"
#!/bin/sh
# Show RowColm numbered MatrixMenu to select Row, Colum: entry.
# add line-no & show some fields of 'df'
df | awk '{print NR " " $0}' | more
echo " 1 2 3 4 5 6"
read -p "ROW/ COLM =" ROW COLM
df |head -$ROW |tail -1 | awk -v n=$COLM '{print $n}'
exit 0
[…]
Terseness only suits you if/when YOU understand it.
Furthermore, it is wrong. Spaces can change between display an input,
and volumnes can be mounted or unmounted.
--
__Pascal Bourguignon__ http://www.informatimago.com/
“The factory of the future will have only two employees, a man and a
dog. The man will be there to feed the dog. The dog will be there to
keep the man from touching the equipment.” -- Carl Bass CEO Autodesk
Nemo
2015-10-18 00:29:14 UTC
Permalink
Post by Pascal J. Bourguignon
Post by n***@gmail.com
I'm writing in LEO now,
What are you doing in Low Earth Orbit?
I think he means he is using the ESA LEO Sparc processor board.
n***@gmail.com
2015-10-18 19:14:09 UTC
Permalink
Post by Pascal J. Bourguignon
Post by n***@gmail.com
I'm writing in LEO now,
What are you doing in Low Earth Orbit?
This forum is for ETHO users who by now SHOULD know about:
ETH Oberon (2.4.3) for Linux x86

Who opened the topic of abreviations?
Post by Pascal J. Bourguignon
Post by n***@gmail.com
#!/bin/sh
# Show RowColm numbered MatrixMenu to select Row, Colum: entry.
# add line-no & show some fields of 'df'
df | awk '{print NR " " $0}' | more
echo " 1 2 3 4 5 6"
read -p "ROW/ COLM =" ROW COLM
df |head -$ROW |tail -1 | awk -v n=$COLM '{print $n}'
exit 0
Terseness only suits you if/when YOU understand it.
Furthermore, it is wrong. Spaces can change between display an input,
and volumnes can be mounted or unmounted.
volumnes are continually mounted AND unmounted.
That's why we need `df`: to see the current status.

As an example of the power of LEO, let's see if I can 'tune' the above,
right here in this screen [without the need to switch].
Some of the colums of `df` were redundant.
Let's see which:
System.Execute df |tail -1 == gives me:
/dev/sda5 97091284 13155380 79003912 15% /mnt/hd
Let's show only columns: 1, 5, 6.
Let's try:
System.Execute df |awk '{print NR " " $1 " : " $5" : " $6}' ==

1 Filesystem : Use% : Mounted
2 /dev/root : 97% : /
3 tmpfs : 0% : /dev/shm
4 /dev/hda16 : 57% : /mnt/ReiseBrdg
5 /dev/hda6 : 90% : /mnt/hdc6
6 /dev/hda11 : 84% : /mnt/hdc11
7 /dev/hda14 : 79% : /mnt/FC1
8 /dev/hda17 : 49% : /mnt/DebDVD1bak
9 /dev/sda5 : 15% : /mnt/hd

No, it's not so good. The 'tabbing' is missing;
and I don't kwnow what the `more` was doing in the original
script, which I copied half-blind from a similar job.

OTOH you're supposed to copy/modify instead of reinventing.
--------------------------------------
Perhaps I can reinstate "tabbing" ?

System.Execute df |awk '{print NR " " $1 \t $5 \t $6}'

awk: {print NR " " $1 \t $5 \t $6}
awk: ^ backslash not last character on line

TOO bad ?!
Pascal J. Bourguignon
2015-10-19 00:39:47 UTC
Permalink
Post by n***@gmail.com
Post by Pascal J. Bourguignon
Post by n***@gmail.com
I'm writing in LEO now,
What are you doing in Low Earth Orbit?
ETH Oberon (2.4.3) for Linux x86
Who opened the topic of abreviations?
Post by Pascal J. Bourguignon
Post by n***@gmail.com
#!/bin/sh
# Show RowColm numbered MatrixMenu to select Row, Colum: entry.
# add line-no & show some fields of 'df'
df | awk '{print NR " " $0}' | more
echo " 1 2 3 4 5 6"
read -p "ROW/ COLM =" ROW COLM
df |head -$ROW |tail -1 | awk -v n=$COLM '{print $n}'
exit 0
Terseness only suits you if/when YOU understand it.
Furthermore, it is wrong. Spaces can change between display an input,
and volumnes can be mounted or unmounted.
volumnes are continually mounted AND unmounted.
That's why we need `df`: to see the current status.
Yes. And that's why you MUST NOT call it twice!

At the very least, write it as:

#!/bin/sh
# Show RowColm numbered MatrixMenu to select Row, Colum: entry.
# add line-no & show some fields of 'df'
temp=/tmp/df.$$
df >$temp
awk '{print NR " " $0}' < $temp | more
echo " 1 2 3 4 5 6"
read -p "ROW/ COLM =" ROW COLM
head -$ROW < $temp | tail -1 | awk -v n=$COLM '{print $n}'
--
__Pascal Bourguignon__ http://www.informatimago.com/
“The factory of the future will have only two employees, a man and a
dog. The man will be there to feed the dog. The dog will be there to
keep the man from touching the equipment.” -- Carl Bass CEO Autodesk
August Karlstrom
2015-10-19 09:35:03 UTC
Permalink
Post by n***@gmail.com
ETH Oberon (2.4.3) for Linux x86
No, this forum is a news group named comp.lang.oberon, which means that
the focus is on the programming language Oberon (in its different versions).


-- August

Loading...