Now I want to make it open a file explorer automagically when the
server becomes available. Linux is not too hard, apart from the
plethora of file explorers available, but windows XPis driving me
nuts.
My python programme contains the clause:
os.popen( "explorer.exe \\\\Server01\\share\\code")
Which does nearly exactly what I want. But it opens the explorer,
without a folders pane on the left hand side, and if I hit the
'folders' button it is showing the path as
My Network Places -> Entire Network -> Microsoft Windows Network ->
Workgroup -> Server01 -> share ->code
Which is all true, but not the most user fiendly way to display it.
Some time ago I created a "My network Places" shortcut called "code on
Solar Server (Server01)" which points to the same place, and if I open
that the folders list is far less complicated and intimidating.
AA: what command line switches will explorer.exe take to open with
the folders list on the left??
BB: How do I specify the "My Network Places" shortcut rather than the
elaborated path??
Ha! Sort of cracked that. Believe it or not, the explorer.exe
command line switches have to be comma-delimited, not space-
delimited. The command I need is very nearly
os.popen( "explorer.exe /e,/root,\\\\Server01\\share\\code")
or
os.popen( "explorer.exe /e,/select,\\\\Server01\\share\\code") .[?]
They do two slightly different things, and I want something sort of
halfway between the two. put any spaces in at all and it all goes
horribly wrong. Good job I do not have spaces in the file names...
> BB: How do I specify the "My Network Places" shortcut rather than the
> elaborated path??
Still can't molish that unto jbex. At all.
.[?] - the \\ are of course escaped \. Passing them through pytbon's
string handler converts them to single ones.
> what command line switches will explorer.exe take to open with
> the folders list on the left??
Not entirely sure there is one ... not many options at all invoking
explorer that way
http://support.microsoft.com/kb/152457
Presumably snakescript can instantiate COM objects? Might have more joy
using "shell.explorer.2"
> Ha! Sort of cracked that. Believe it or not, the explorer.exe
> command line switches have to be comma-delimited, not space-
> delimited. The command I need is very nearly
> os.popen( "explorer.exe /e,/root,\\\\Server01\\share\\code")
Jolly good.
Out of interest why are you using "pipe open", does explorer splurge
anything useful to stdout?
> Might have more joy using "shell.explorer.2"
I probably mean "shell.Shell_Application" which deals with Windows
Exploder, rather than Internet Exploder.
No, but none of the other methods of running shell commands seem to be
able to cope with the presence of command line parameters. only popen
seems to cope.
And anyway, what sort of moron writes a .exe that takes comma
delimited arguements? Cvyybpxf.
I don't want all that complication, it was supposed to be a quick
convenience tool.
Got another problem under linux now. I set up a socket to listen for
broadcasts from the server, but that does not always get closed when I
exit the application. Instead it ends up owned by the file explorer
window I open, and I have to close that before I can re-open the
app. So now I have to keep track of the file explorer window and
close that too.
What I originally wanted to do was open the file explorer so it
displayed inside the window for my remote control tool, but that seems
all but impossible.
> Got another problem under linux now. I set up a socket to listen for
> broadcasts from the server, but that does not always get closed when I
> exit the application. Instead it ends up owned by the file explorer
> window I open, and I have to close that before I can re-open the
> app. So now I have to keep track of the file explorer window and
> close that too.
You need to close the socket after the fork() and before the exec()
of the file explorer.
--
Steve O'Hara-Smith | Directable Mirror Arrays
C:>WIN | A better way to focus the sun
The computer obeys and wins. | licences available see
You lose and Bill collects. | http://www.sohara.org/
One who's been told a cli has to be there but no-one'll use it ?
--
Richard Robinson
"The whole plan hinged upon the natural curiosity of potatoes" - S. Lem
My email address is at http://www.qualmograph.org.uk/contact.html
alas, it ain't that simple. You can fork the file explorer at any
time, and the socket has to be polling for status perhaps long after.
Looks like I'm going to have to make the socket read non-blocking,
loop looking at "select" and only call recv when there is something to
do. Then when the loop gets shut down I can call close.
> On Apr 25, 10:37 am, Ahem A Rivet's Shot <ste...@eircom.net> wrote:
>
>> You need to close the socket after the fork() and before the exec()
>> of the file explorer.
>
> alas, it ain't that simple. You can fork the file explorer at any
> time, and the socket has to be polling for status perhaps long after.
Set the socket so it's not inheritable as soon as it's created?
http://msdn.microsoft.com/en-us/library/ms724935%28v=vs.85%29.aspx
maybe there's some setsockopt that does it in a more portable way?
i did an import(socket) and a help(socket) and can't seem to find
one. Reading round it seems as though "select" is the way to go, so
I shall do that.
in answer to your earlier question about why am using popen(), I
revisited it, and for python3 that appears to be the cannonical
solution for everything.
I am now fighting intermittent WOL performance, which was flawless in
the 6 months since I started testing the principle, but failed
eratically yesterday and today. I'm not sure, but I think that
installing nfs netjbexvat may well be the culprit. I ran apt-get
install nfs-common over the weekend, and running at-get remove nfs-
common seems to have fixed it. bugger.
Either when I run pm-suspend-hybrid to put the machine to sleep it
starts up again straight away, or it goes to sleep and then ignores
wol packets and the front panel switch (both of which reliably woke it
up for months). I can't use pm-hibernate as it always wakes up
immediately after closing down, to my considerable annoyance. some
reading around suggests I need to add a package called "uswsusp" which
will also give me a userspace method of shutting down
next issue: what are the 1, or 2, zombie processes reported when I ssh
in? Don't know.
its a lot of bother when I could have ohl'd a nas box from marc (?)
with an arm cpu, and made a better job of the solar power setup. But
I was insistent I wanted to be able to email get_iplayer commands to
the box while I was around the whirled,a nd use my HUGE disks to
accumulate pogroms while I was out of the country. By the time I get
it jbexvat get_iplayer will have been defeated by drm.
Oh well, I've taught meself bits of Python, so that's a good thing -
E.G. if you want to use a global variable, you don't declare it global
at the outermost scope. Oh no. You declare it normally there, then
declare it global in the inner scopes where it would normally be
invisible. That all makes perfect sense ("look over the fence for
this one") but none of the documentation or the two expensive books I
have tell you that. they woffle, in an ambiguous and inexact way,
making me think I needed the global statement in the outer scope
("shine this one into everyone's cubicle") . Documentation, lads.
> in answer to your earlier question about why am using popen(), I
> revisited it, and for python3 that appears to be the cannonical
> solution for everything.
If explorer doesn't output anything to stdout it shouldn't cause a
promble, I unforget there being issues where you use popen (or similar
methods in other languages natch) as a quick substitute for fork/exec
and then omit to read from the pipe in a loop, at some random time the
pipline fills up and the spawned command grinds to a halt.
> if you want to use a global variable, you don't declare it global
> at the outermost scope. Oh no. You declare it normally there, then
> declare it global in the inner scopes where it would normally be
> invisible. That all makes perfect sense ("look over the fence for
> this one")
powershell has (pinched) the same concept.
> but none of the documentation or the two expensive books I
> have tell you that. they woffle, in an ambiguous and inexact way,
Sounds remarkably similar to my rant against powershell and dotnet docs
a few fortnights ago, bring back the orange wall ... lovely docs.
I had a look at powershell. What a misbegotten pile of wreckage.
There are certainly a several of fundamental things I dislike about it,
but the basic concept of piping objects around, rather than lines of
text than need grepping or awking, is interesting.
Regardless of whether or not I like it, there are things that absolutely
require it in the brave arj mickeysloth world.
>
> Regardless of whether or not I like it, there are things that absolutely
> require it in the brave arj mickeysloth world.
Like $MEGACORP. Tied in so hard they've stopped struggling.
Shortcut on your machine won't jbex as Explorer wants either directory
name or a share name in the parameters.
Untested but on Server01 create a ShareName for \\Server01\share\code of
"code on Solar Server (Server01)", then
os.popen( "explorer.exe /e,/root,\\\\code on Solar Server (Server01)" )
--
Pedt
Cryptic Clues Round 5, #1
Painter sounds like he fiddles with his backside. (10)
In this case: to allow folder, share and file names with spaces...
--
Pedt
Cryptic Clues Round 5, #1
Painter sounds like he fiddles with his backside (10)
> bobharvey <robert...@my-deja.com> wibbled
>
>> what sort of moron writes a .exe that takes comma
>> delimited arguements? Cvyybpxf.
>
> In this case: to allow folder, share and file names with spaces...
That's what double quotes is for. I've never really trusted spaces in
filenames ever since Win95 introduced them, too many places that they
b0rk, what's wrong with underscores eh?
[FX: Rambles off, muttering about the number of scripts that b0rk when
they encounter surnames like O'Connor or Fanningsworth-Smythebottom]
> Pedt wrote:
>
> > bobharvey <robert...@my-deja.com> wibbled
> >
> >> what sort of moron writes a .exe that takes comma
> >> delimited arguements? Cvyybpxf.
> >
> > In this case: to allow folder, share and file names with spaces...
>
> That's what double quotes is for. I've never really trusted spaces in
> filenames ever since Win95 introduced them, too many places that they
> b0rk, what's wrong with underscores eh?
Win95 introduced them ?? I think not. You could put spaces in
filenames in CP/M (although ????????.??? was a much nastier thing to put in
the name field of a directory entry) and of course spaces were always
allowed in Unix filenames, both long before Windows.
> [FX: Rambles off, muttering about the number of scripts that b0rk when
> they encounter surnames like O'Connor or Fanningsworth-Smythebottom]
[FX: Wonders off mumbling about yoofertoday]
Yebbut other O/S allowed spaces from the start so pogroms yrnearq to
cope with them, however DOS (and windows sitting on top of it) banned
spaces until Win95 which allowed long names and spaces, which then
"surprised" all manner of pogroms.
> You could put spaces in
> filenames in CP/M (although ????????.??? was a much nastier thing to put in
> the name field of a directory entry) and of course spaces were always
> allowed in Unix filenames, both long before Windows.
I has done assembler programming of CP/M FCBs on Superbrians (and OS/M
on MIMIs) ...
<bluster>
Was that old "Stinky" Fanningsworth-Smythebottom of the 49th? Set
fire to the billiard room at the Poonah officer's club back in '32?
Married that skinny girl who was suppose to be a by-blow of the Prince
Regent and an Irish Duchess? I think their 3rd son inherits the
earldom and a castle in Bohemia under the terms of a 12th century
entail, provided he stays out of the police courts and wears a hat on
St Difficult's day.
I was in the remove at St Floggings with his brother, don't-cher-
know. Killed playing Hares and Hounds against Unheated Hall.
Terrible, had to forfeit the match.
Anyway "Stinkey" had this tin leg, after he saw action aginst the
Bombast of Baldoristan....
<fx: wanders off along long gallery in search of a drink>
</emsworth>
Good effort, but nill points:
My Network Places -> Entire Network -> Microsoft Windows Network ->
Workgroup -> Server01 -> \\Server01\code on Solar Server (Server01)
I.e. the whole "entire network" path is still opened.
Bummer.
> Ahem A Rivet's Shot wrote:
> > On Wed, 27 Apr 2011 07:47:14 +0100
> > Sunny Bard <sunn...@txinfo.org> wrote:
> >
> >> Pedt wrote:
> >>
> >>> bobharvey <robert...@my-deja.com> wibbled
> >>>
> >>>> what sort of moron writes a .exe that takes comma
> >>>> delimited arguements? Cvyybpxf.
> >>>
> >>> In this case: to allow folder, share and file names with spaces...
> >>
> >> That's what double quotes is for. I've never really trusted spaces in
> >> filenames ever since Win95 introduced them, too many places that they
> >> b0rk, what's wrong with underscores eh?
> >
> > Win95 introduced them ?? I think not.
>
> Yebbut other O/S allowed spaces from the start so pogroms yrnearq to
> cope with them, however DOS (and windows sitting on top of it) banned
> spaces until Win95 which allowed long names and spaces, which then
> "surprised" all manner of pogroms.
There is that.
> > You could put spaces in
> > filenames in CP/M (although ????????.??? was a much nastier thing to
> > put in the name field of a directory entry) and of course spaces were
> > always allowed in Unix filenames, both long before Windows.
>
> I has done assembler programming of CP/M FCBs on Superbrians (and OS/M
> on MIMIs) ...
Ever try to remove a file with ????????.??? in the FCB ? That
"feature" (and the underlying causal hack) is one of the main reasons I
wrote CPN for the Torch instead of porting CP/M.
I recall that one of the Datapoint OSs would let you specify a file
name either in text or as hex codings perhaps that was why.
wasn't there some trick involving following inode numbers in Unix?
bypassing file names altogether?
I rather applaud case-sensitivity. But I suppose I was already used
to it when winjows came along to baffle me.
True. But the same is true of any other mis-spelling.
I suddenly wonder, how many times are filenames/urls spelled out or retyped,
compared with how often they're c&p'ed ?
> I can see, from a purist point of view, that it's "correct"; a is not A,
> and so on. But from a practical POV, it's pants.
I dunno. If you get used to it, it can seem to add more usefulness to a
directory-listing. Expressiveness, clarity. All the reasons why it's handy
in other writing.
> [1] I believe that you can make Apache at al case-agnostic, but it
> doesn't come out of the box that way.
Has anybody got a better candidate than the apostrophe for an all-purpose
intra-word separator ? Hyphen, possibly ? c&p-ed ? No nicer. c&ped, nah.
Oh well, OTTOMH doesn't always jbex.
>My Network Places -> Entire Network -> Microsoft Windows Network ->
>Workgroup -> Server01 -> \\Server01\code on Solar Server (Server01)
>
>I.e. the whole "entire network" path is still opened.
>
>Bummer.
Also untested (single machine available at the moment, t'other is on a
mammoth backup wbo[1]), if clicking on the shortcut does what you want
in terms of address bar, might be worth copying the shortcut somewhere
easily accessible and then use the shortcut as the argument to os.popen?
Otherwise the only suggestion I can think of at the moment would be to
use "Map Network Drive" to \\Server01\share\code\ but that gives you a
bare drive letter in Exploder which is probably not what you want.
Which OS are you doing this from BTW, might find summat useful in my
largish collection of PDFs that'll help.
[1] 2 x 1TB NAS (yclept Harrods1 & Harrods2) backed up to compressed
archives in the Attic (1TB USB) with Paragon Drive Backup. Not really
fast even on a 2.1GHz Tri Core Phenom with 4GB RAM. [2]
[2] I know, I know. Waste of that machine to have Vespa on it but some
stuff won't jbex [well] under XP and/or gives two fingered salutes in
Win2K+3 & there's no driver yet for my all-in-one copier/scanner/printer
to move to Win7.
--
Pedt
Cryptic Clues Round 5, #1
Painter sounds like he fiddles with his backside (10)
Indeedy but disunforget summat about Win95, Exploder and ShellExt and
backwards compatible that would have b0rked a lot of Windows bits
>I've never really trusted spaces in
>filenames ever since Win95 introduced them, too many places that they
>b0rk, what's wrong with underscores eh?
Catering for the masses who wanted a space between worms innit.
I tend to use a . or JustRunThemTogetherInProperCase plus times get a -
as : causes its own problems. Most people seem to prefer the spaces as
it looks like proper (not Proper) worms.
Far bigger problem was LFNs themselves and the cccccc~c.ext short names.
It b0rked a lot of software that went helix in the nether region garment
when run under Win95 et al.
I was lucky where I then jbexed as I'd written most of the inhouse stuff
in Borland Pascal with 8.3 names so it did not really affect us - though
I did have to very rapidly write a LFN unit to deal with file import and
rewrite the parsing for input filenames as some people insisted on using
very descriptive filenames just because they could.
>
>[FX: Rambles off, muttering about the number of scripts that b0rk when
>they encounter surnames like O'Connor or Fanningsworth-Smythebottom]
>
I crashed a demo of an arj [to us] all-chanting-all-cavorting payroll
system upgrade by feeding it Erwin Schrödinger. Also crashed it after
they'd reinstalled with SWWTM's full name. Oops! Like an overloaded
postman: too many letters. Yet another crash. Boss amused, fixed when
we took delivery and they knocked a bit extra off the price. No bonus
though.
Yep. Printer part jbexeth in a brief foray into Win7. Scanner zilch.
Printer I really don't need, the Samsung CLP-300 jbexes under Win2K+3
with the Universal Driver [as does the ancient Panasonic KXP-4000 that
does 1ppm when I can get the toner] and in fact is a bit better than the
dedicated driver for Vespa. Scanner I could do without temporarily as I
can
Not looked in the last couple of months admittedly for the all in one
but last I looked "there were no plans to..." Yeah, as though I'm going
to ohl an arj one to get something that jbexes under Win7.
ISTM that there's an awful lot of manufacturers who are doing the 'if
you ohl/move to Win7 then you need an arj <whatever> as we won't support
<old_whatever> and here is the $PRICE if the Vespa drivers don't jbex'.
BTW I've found, when helping a few bods, that sometimes the Win2xxx
drivers jbex under Win7 when XP or Vespa drivers don't.
--
Tciao for Now!
John.
> I rather applaud case-sensitivity. But I suppose I was already used
> to it when winjows came along to baffle me.
Store the case yes, but matching with regard to case, not keen myself, I
dislike the arjre linuxisms like NetworkManager rather than networkmanager
> On Apr 27, 9:35 am, Ahem A Rivet's Shot <ste...@eircom.net> wrote:
> > Ever try to remove a file with ????????.??? in the FCB ? That
> > "feature" (and the underlying causal hack) is one of the main reasons I
> > wrote CPN for the Torch instead of porting CP/M.
>
> I recall that one of the Datapoint OSs would let you specify a file
> name either in text or as hex codings perhaps that was why.
Nope.
> wasn't there some trick involving following inode numbers in Unix?
> bypassing file names altogether?
Yebbut this is CP/M, the catch here is that ? is the wild card
character so attempting to delete ????????.??? would delete every file. To
make matters worse (this is the bug I refused to accept for Torch) files
greater than (IIRC) 16K in CP/M have multiple directory entries (the extras
were called extents) and so even the entry point where you pointed to a
directory entry and said "delete this one" had to search every directory
entry and delete all the ones that matched the name in order to pick up the
extents. In short there was no way to delete a file called ????????.???
without deleting everything on the disc.
> Store the case yes, but matching with regard to case, not keen myself, I
> dislike the arjre linuxisms like NetworkManager rather than
> networkmanager
I gubhtug that was Windowsprogrammingism, not a linuxism.
--
Anahata
ana...@treewind.co.uk -+- http://www.treewind.co.uk
Home: 01638 720444 Mob: 07976 263827
> On Wed, 27 Apr 2011 19:25:58 +0100, Sunny Bard wrote:
>
>> I dislike the arjre linuxisms like NetworkManager
>
> I gubhtug that was Windowsprogrammingism, not a linuxism.
Well, it's found its way into several recent Gnomish bits of Linux ...
Writers in Byte Magazine used to refer to it as CamelCase
I think I first saw it in the Windows 3 SDK, with type-clues in front. I
think they called it "Hungarian".
Such has been its name for some time...
"The earliest use of the name "CamelCase" occurs in 1995, in a post by
Newton Love.[29] "With the advent of programming languages having these
sorts of constructs, the humpiness of the style made me call it
HumpyCase at first, before I settled on CamelCase. I had been calling it
CamelCase for years," said Love, "The citation above was just the first
time I had used the name on USENET.""
snipped from
http://en.wikipedia.org/wiki/Camelcase#History_of_the_name_.22camel_case
.22
--
Skipweasel - never knowingly understood.
Hungarian was something else. In the absence of type checking there
were rules about variable naming that put nearly unencipherable
perfixes on everything.
strTitle: A string used to contain a title
ictrFloors: an integer used as a counter, denoting something to do
with floors
Not entirely something-else, then; more ThatCapitalisation with an extra bit
in front. WottIsaid.
In '93/4
> bobharvey said:
> > On Apr 28, 6:14 pm, Sunny Bard <sunnyb...@txinfo.org> wrote:
> >> Anahata wrote:
> >> > On Wed, 27 Apr 2011 19:25:58 +0100, Sunny Bard wrote:
> >>
> >> >> I dislike the arjre linuxisms like NetworkManager
> >>
> >> > I gubhtug that was Windowsprogrammingism, not a linuxism.
> >>
> >> Well, it's found its way into several recent Gnomish bits of Linux ...
> >
> > Writers in Byte Magazine used to refer to it as CamelCase
>
> I think I first saw it in the Windows 3 SDK, with type-clues in front. I
> think they called it "Hungarian".
Hungarian notation is indeed giving every variable name a type
prefix, it can be in camelCase or underscore_separated or justonelongstring
style, so long as there's a type prefix it's Hungarian notation. I *hate*
it, I want variable names to tell me what the variable is for not how it's
implemented.
> bobharvey said:
>> On Apr 28, 7:17 pm, Richard Robinson <richa...@privacy.net> wrote:
>>> I think I first saw it in the Windows 3 SDK, with type-clues in front.
>>> I
>>> think they called it "Hungarian".
>>
>> Hungarian was something else. In the absence of type checking there
>> were rules about variable naming that put nearly unencipherable
>> perfixes on everything.
>>
>> strTitle: A string used to contain a title
>> ictrFloors: an integer used as a counter, denoting something to do
>> with floors
>
> Not entirely something-else, then; more ThatCapitalisation with an extra
> bit
> in front. WottIsaid.
>
> In '93/4
>
Bring back reverse Polish!
--
"Nuns! NUNS! Reverse! Reverse!"
Turns out to be a known bug: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/289252
known for a couple of years. I don't understand why it only started
affecting me two days ago, I can only suppose a kernel upgrade
introduced a regression. However the work-around in the bug seems to
have fixed it. Weird.
It is, in fact, doubly weird. Because the fix involves unbinding usb
handling from the kernel, and I am booted from usb. I have no idea
how it finishes shutting down, or how it starts up again, but it does
and that is a huge step forward. I've removed "uswsusp" and the other
fixes I found on the web and tried. Its all betterer now.
I'll try to put nfs back some time over the weekend. And postgresql
and postifx which I have removed to molish some space.
Behind you, I note.
> Hungarian was something else. In the absence of type checking there
> were rules about variable naming that put nearly unencipherable
> perfixes on everything.
>
> strTitle: A string used to contain a title
> ictrFloors: an integer used as a counter, denoting something to do
> with floors
I remember programming in Fortran (in fact, it would have been FORTRAN
then) in the mid-70s. If your variable name started with I, J, K, L,
M, or N, it was an integer, otherwise it was a real.
--
Mike Fleming
Yeah. Wipe the table with it in front of the TV cameras and another layer of
dust gets blown on.
Only in the absence of a declaration to the contrary.
I /like/ Fortran
It horrified me when I first saw it. I pogrammers can't be trusted
not to assign a string value to a pointer, you need a proper language/
compiler, not longer gibberish.
Underscore jbexeth for me, too. It don't think it goes so well in the big
wide world of ungeeks, though ?
>>On Apr 29, 5:18?am, Ahem A Rivet's Shot <ste...@eircom.net> wrote:
>>> > I remember programming in Fortran (in fact, it would have been FORTRAN
>>> > then) in the mid-70s. If your variable name started with I, J, K, L,
>>> > M, or N, it was an integer, otherwise it was a real.
Still is, with the caveat below, but IMPLICIT NONE has been in the
standard for a while now.
>>> ? ? ? ? Only in the absence of a declaration to the contrary.
>>I /like/ Fortran
Ich auch.
> It's the first time I've thought of it in years- it was my first
> language, being a physics undergrad at the time. But I learned
> MACRO-10, and the damage was done.
Oh, dear. I taught myself PAL-III in three months, simultaneously
writing my real-time data acquisition system (on paper, of course!).
I think the Fortran 2008 standard is now ratified, but unfortunately
few implementations yet contain all the features of the 2003 standard. '08
is a smaller increment and may be fully implemented more quickly, except
perhaps for coarrays.
--
Ivan Reid, School of Engineering & Design, _____________ CMS Collaboration,
Brunel University. Ivan.Reid@[brunel.ac.uk|cern.ch] Room 40-1-B12, CERN
KotPT -- "for stupidity above and beyond the call of duty".
>>I remember programming in Fortran (in fact, it would have been FORTRAN
>>then) in the mid-70s. If your variable name started with I, J, K, L,
>>M, or N, it was an integer, otherwise it was a real.
> Hence the old FORTRAN joke: "God is real, unless declared integer."
> You could override the usual implicit rules, of course.
> A lot of my early programming efforts started with "IMPLICIT INTEGER
> A-Z".
I had to re-do the Monte-Carlo calculations of a contemporary PhD
student, modelling electrons drifting in hydrogen, and it seems he must
have initially forgotten this rule for one of his few data declarations
was
REAL MEAN
In FORTRAN66, and I think FORTRAN77, and for all I know, later FORTRANs,
you could create all kinds of havoc by sticking a literal constant
in the argument list of a subroutine call that modified those arguments.
Which is why I prefer the languages that differentiate more clearly between
call by name and call by value
--
A fine wine may be judged with only one sip,
but it's better to be thoroughly sure.
>> >>I /like/ Fortran
> In FORTRAN66, and I think FORTRAN77, and for all I know, later FORTRANs,
> you could create all kinds of havoc by sticking a literal constant
> in the argument list of a subroutine call that modified those arguments.
These days (i.e. since F90) you can declare parameter intents: IN,
OUT, and INOUT so the compiler can catch such abuses of the standard.
Modern processor technology also catches attempts to write to
non-modifiable storage.
> Which is why I prefer the languages that differentiate more clearly between
> call by name and call by value
Fortran makes no requirement as to how parameters are passed; it's
_usually_ by reference, but that is by no means mandated.
It wasn't really an abuse of the standard - an undergrad neophyte
programmer did it purely by dint of inexperience. Once we'd found his
error for him, we did experiment with abusing the standard this way,
and in fact used it in a programming course as an example of:
(a) how easy it is to make things go wrong
(b) how to correctly think about argument lists
(c) how constants aren't, actually
>> On Fri, 29 Apr 2011 22:19:01 +0100, Dave Budd <da...@davebudd.org.ku>
>> wrote in <MPG.28253b9f8...@News.Individual.NET>:
>> > In FORTRAN66, and I think FORTRAN77, and for all I know, later FORTRANs,
>> > you could create all kinds of havoc by sticking a literal constant
>> > in the argument list of a subroutine call that modified those arguments.
>> These days (i.e. since F90) you can declare parameter intents: IN,
>> OUT, and INOUT so the compiler can catch such abuses of the standard.
> It wasn't really an abuse of the standard - an undergrad neophyte
> programmer did it purely by dint of inexperience. Once we'd found his
> error for him, we did experiment with abusing the standard this way,
> and in fact used it in a programming course as an example of:
> (a) how easy it is to make things go wrong
> (b) how to correctly think about argument lists
> (c) how constants aren't, actually
Well, yes, the term usually used in comp.lang.fortran is "non
standard-compliant" and in fact the "processor" is not required to catch
and report all such non-compliancies (e.g. it can be hard to catch
violations of the rule about not aliasing subprogram arguments, IIRC).
But these days, I think the hardware and compiler architects are
well aware of this gotcha and you'd be hard-pressed to find a modern
system that gets this wrong.
>> (c) how constants aren't, actually
> But these days, I think the hardware and compiler architects are
> well aware of this gotcha and you'd be hard-pressed to find a modern
> system that gets this wrong.
Oops, I was wrong:
===
Compaq_Owner@HomePC01 /tmp
$ uname -a
CYGWIN_NT-5.1 HomePC01 1.7.6(0.230/5/3) 2010-08-16 16:06 i686 Cygwin
Compaq_Owner@HomePC01 /tmp
$ gfortran -v
Using built-in specs.
Target: i686-pc-cygwin
Configured with: ../gcc44/configure --prefix=/usr/local/gfortran
--enable-languages=c,fortran --disable-bootstrap --enable-threads=posix
--enable-sjlj-exceptions --enable-version-specific-runtime-libs --enable-nls
--disable-libmudflap --disable-shared --disable-win32-registry
--with-system-zlib --enable-checking=release --enable-werror
--without-included-gettext --without-x --enable-libgomp :
(reconfigured) ../gcc44/configure --prefix=/usr/local/gfortran
--disable-bootstrap --enable-threads=posix --enable-sjlj-exceptions
--enable-version-specific-runtime-libs --enable-nls --disable-libmudflap
--disable-shared --disable-win32-registry --with-system-zlib
--enable-checking=release --enable-werror --without-included-gettext
--without-x --enable-libgomp --enable-languages=c,fortran --no-create
--no-recursion
Thread model: posix
gcc version 4.4.0 20090118 (experimental) (GCC)
Compaq_Owner@HomePC01 /tmp
$ cat testconst.f90
SUBROUTINE change(i)
IMPLICIT NONE
INTEGER i
i = 10
RETURN
END SUBROUTINE change
PROGRAM testconst
IMPLICIT NONE
WRITE(*,*) 6
CALL change(6)
WRITE(*,*) 6
END PROGRAM testconst
Compaq_Owner@HomePC01 /tmp
$ gfortran testconst.f90
Compaq_Owner@HomePC01 /tmp
$ ./a.exe
6
10
===
That's a bit old though; let's try my Ubuntu system rather than an
old cygwin install:
===
ivan@quad-server:/tmp $ uname -a
Linux quad-server 2.6.35-28-generic #50-Ubuntu SMP Fri Mar 18
18:42:20 UTC 2011 x86_64 GNU/Linux
ivan@quad-server:/tmp $ gfortran -v
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v
--with-pkgversion='Ubuntu/Linaro 4.4.4-14ubuntu5'
--with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-4.4 --enable-shared --enable-multiarch
--enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix
--with-gxx-include-dir=/usr/include/c++/4.4 --libdir=/usr/lib --enable-nls
--with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug
--enable-objc-gc --disable-werror --with-arch-32=i686 --with-tune=generic
--enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu
--target=x86_64-linux-gnu
Thread model: posix
gcc version 4.4.5 (Ubuntu/Linaro 4.4.4-14ubuntu5)
ivan@quad-server:/tmp $ gfortran testconst.f90
ivan@quad-server:/tmp $ ./a.out
6
Segmentation fault
===
More what I expected!
That was a manual install of gfortran in cygwin, I'll see if I can
download the latest virgin from the cygwin repository. Have to kill this
X11 instance to upgrade tho' -- more later.
>>> (c) how constants aren't, actually
>> But these days, I think the hardware and compiler architects are
>> well aware of this gotcha and you'd be hard-pressed to find a modern
>> system that gets this wrong.
> Oops, I was wrong:
>===
> Compaq_Owner@HomePC01 /tmp
> $ cat testconst.f90
> SUBROUTINE change(i)
> IMPLICIT NONE
> INTEGER i
> i = 10
> RETURN
> END SUBROUTINE change
> PROGRAM testconst
> IMPLICIT NONE
> WRITE(*,*) 6
> CALL change(6)
> WRITE(*,*) 6
> END PROGRAM testconst
> Compaq_Owner@HomePC01 /tmp
> $ gfortran testconst.f90
> Compaq_Owner@HomePC01 /tmp
> $ ./a.exe
> 6
> 10
>===
> That was a manual install of gfortran in cygwin, I'll see if I can
> download the latest virgin from the cygwin repository. Have to kill this
> X11 instance to upgrade tho' -- more later.
Ubggre! The current cygwin repository version of gfortran is
exactly the one I'd manually installed in Jan 2009. Same result... :-(
Didn't find a g95 version in the repository, either.
--
Ivan Reid, School of Engineering & Design, _____________ CMS Collaboration,
Brunel University. Ivan.Reid@[brunel.ac.uk|cern.ch] Room 40-1-B12, CERN
> I had to re-do the Monte-Carlo calculations of a contemporary PhD
> student, modelling electrons drifting in hydrogen, and it seems he
> must have initially forgotten this rule for one of his few data
> declarations
> was
>
> REAL MEAN
DON'T USE PASCAL?
--
Dave Larrington
<http://www.legslarry.beerdrinkers.co.uk>
Unloading, please wait.
IMPLICIT NONE always worked for me...
--
Dave Larrington
<http://www.legslarry.beerdrinkers.co.uk>
If you want a bicycle, buy a bicycle. If you want something
that folds, buy a deckchair.
On 04/05/2011 11:07, Dave Larrington wrote:
> In news:slrnirlqi8.i...@smtp.orangehome.co.uk,
> Ivan D. Reid <Ivan...@ivan.fsnet.co.uk> tweaked the Babbage-Engine to tell
> us:
>
>> I had to re-do the Monte-Carlo calculations of a contemporary PhD
>> student, modelling electrons drifting in hydrogen, and it seems he
>> must have initially forgotten this rule for one of his few data
>> declarations
>> was
>>
>> REAL MEAN
>
> DON'T USE PASCAL?
Shouldn't that be:
VAR MEN : REAL;
DO NOT USE PASCAL
I hate you for reminding me of Pascal programming. Only FORTRAN could be
worse.
- --
Guy Chapman, http://www.chapmancentral.co.uk
The usenet price promise: all opinions are guaranteed
to be worth at least what you paid for them.
PGP public key at http://www.chapmancentral.co.uk/pgp-public.key
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iQEcBAEBAgAGBQJNwZf2AAoJEJx9ogI8T+W//84IAI4Dj+mQkxvFRnvkeSgK9YJS
PR9e61CYNbSDdUl1P3WOLoz5oWo1r4Kw2NbF2C4YurYoETO8h9q7Jtg1qqspCdw5
cXktFCGHiBemhVcRnHSQptoLB43Z+WrEZEhlhNvrevbjti0sfEelpfKx6TzHXmF3
H8YMA/ropWJEuXQMYKANg7Gexdhc4NxB10kyAEl8R0rPwkI3UsBwfaL+BjejzSHE
yldmip0wnb6JL0m1XVfFwBx/+lKTWk3RSZYaiA1vdZx8nHo1sK3GitW9SrL2N9pR
Xk6Mu/4xZQViq6bj4Q+xp/6sNQWuBuCLGe17RYdGbYTkC7osXZGuxTsGx8E5o3c=
=6GSK
-----END PGP SIGNATURE-----
> I hate you for reminding me of Pascal programming. Only FORTRAN could be
> worse.
PBOBY would be at the bottom of my list ...
Lots of things could be. Not all of them are implemented.
Juvgrfcnpr, oenvashpx ?
> Sunny Bard <sunn...@txinfo.org> wrote:
>
>> Just zis Guy, you know? wrote:
>>
>>> I hate you for reminding me of Pascal programming. Only FORTRAN could be
>>> worse.
>>
>> PBOBY would be at the bottom of my list ...
>
> Juvgrfcnpr, oenvashpx ?
They would be an "interesting exercise" ...
Pascal was fine, except that nobody ever did the interfaces to the
hardware properly. Apart from that, a very nice language.
Befunge !
>> I hate you for reminding me of Pascal programming. Only FORTRAN could be
>> worse.
> Pascal was fine, except that nobody ever did the interfaces to the
> hardware properly. Apart from that, a very nice language.
Well, the story I heard was that Wirth never intended there to be a
compiler, it was meant to be a teaching (pseudo-)language. But of course,
someone had to go and implement it...
> Pascal was fine, except that nobody ever did the interfaces to the
> hardware properly. Apart from that, a very nice language.
Agreed. I jbexed for years with Prospero Pascal, which had a few well-
chosen extensions to make it a a lot nicer to use (separate compilation
and strings especially) and was one of the most bug-free pieces of
software I've ever used.
I wrote my own hardware interfaces in assembubbler. That wasn't so easy.
--
Anahata
ana...@treewind.co.uk -+- http://www.treewind.co.uk
Home: 01638 720444 Mob: 07976 263827
> In article <20110504202004....@eircom.net>,
> ste...@eircom.net says...
>>
>> On Wed, 04 May 2011 19:45:24 +0100
>> Sunny Bard <sunn...@txinfo.org> wrote:
>>
>> > Just zis Guy, you know? wrote:
>> >
>> > > I hate you for reminding me of Pascal programming. Only FORTRAN
>> could be
>> > > worse.
>> >
>> > PBOBY would be at the bottom of my list ...
>>
COME-FROM?
>> Juvgrfcnpr, oenvashpx ?
>
> Befunge !
>
ARM asm
--
"Nuns! NUNS! Reverse! Reverse!"
> On Wed, 04 May 2011 22:08:39 +0100, Dave Budd <da...@davebudd.org.ku>
> wrote:
>
> > In article <20110504202004....@eircom.net>,
> > ste...@eircom.net says...
> >>
> >> On Wed, 04 May 2011 19:45:24 +0100
> >> Sunny Bard <sunn...@txinfo.org> wrote:
> >>
> >> > Just zis Guy, you know? wrote:
> >> >
> >> > > I hate you for reminding me of Pascal programming. Only FORTRAN
> >> could be
> >> > > worse.
> >> >
> >> > PBOBY would be at the bottom of my list ...
> >>
>
> COME-FROM?
Intercal ? I never had the pleasure (thankfully). XSLT has flow
control that looks like come-from with regular expressions and precedence
rules for the target.
> >> Juvgrfcnpr, oenvashpx ?
> >
> > Befunge !
> >
>
> ARM asm
I always thought that was quite a nice assembler (but I've only
written for very early ARMs).