generics puzzle

T

Tom Anderson

Its a good idea to know at least how to get by with vi. Two reasons:

- it needs about the least terminal features to work correctly (this
includes being able to work without arrow or function keys), so if your
system gets completely borked you may need it to get out of the hole
without data loss.

ed. http://www.gnu.org/fun/jokes/ed.msg
- its colon command mode is very powerful and can make repetitive changes
much better than editors that don't understand regexes.

sed. http://www.eng.cam.ac.uk/help/tpl/unix/sed.html

tom
 
T

Tom Anderson

I'd rather pull my own teeth with a string tied to a doorknob. A much
easier method is to install the hard drive into a functional system as a
slave, then bring the full power of complex, modern tools to bear upon
fixing whatever troubled files are on it that need fixing.

Yeah, that works great when the drive in question is in a rack an ocean
away. Or, indeed, a desk away - are you seriously saying you'd prefer to
pull a disk than to SSH into a machine to fix something in a few seconds?
Because if so, you're an idiot.

Seriously, you can argue with the use of a text-mode editor on the
desktop, you can argue with vi being the best choice for a text-mode
editor, but you can't argue with the utility of text-mode editors in
general. They're an essential blade in the working geek's Swiss army
knife.

tom
 
E

Eight of Seventeen

Yeah, that works great when the drive in question is in a rack an ocean
away.

If you have a computer system you rely on, but no reliable boots on
the ground where that system is, then that's your problem. What would
you do if the same computer suffered hardware failure?

Similarly, you have a problem if there isn't something you can do to
restore last night's backup to fix a problem when all else fails, but
the hardware's OK. Preferably, something that amounts to just pushing
a button, authenticating with some password, and confirming.
Or, indeed, a desk away - are you seriously saying you'd prefer to
pull a disk than to SSH into a machine to fix something in a few seconds?

If the latter entails using software that'd set my hair on fire, then
yes.
Because if so, you're an [insult deleted].

No. None of the nasty things that you have said or implied about me
are at all true.
Seriously, you can argue with the use of a text-mode editor on the
desktop, you can argue with vi being the best choice for a text-mode
editor, but you can't argue with the utility of text-mode editors in
general. They're an essential blade in the working geek's Swiss army
knife.

At best, they ought to be behind a panel that says "In Case Of
Emergency, Break Glass". They're simply massively outclassed under any
other circumstances. And as I pointed out you can *usually* avoid
having to resort to such horrors even when there *is* an emergency.
 
B

blmblm

[ snip ]
The key thing (har har) to know is that all Eclipse's key bindings are
configurable, and that there are a great many commands it has which do not
have bindings by default.

Yes, that sounds vaguely familiar ....
My pet hate is that there are no keystrokes for the 'extract constant' and
'extract parameter' refactorings. It's not long after i sit down with an
unfamiliar Eclipse that i find myself binding them to the otherwise unused
alt-shift-K and alt-shift-P combinations (fitting neatly into the
alt-shift family, which operates the other refactorings).

You can examine and configure the key bindings in the 'Keys' page in the
preferences. Which you can reach without the mouse by typing the keystroke
to open the preferences window (command-, on the Mac; can't remember what
it is on Linux),

Maybe not bound to a key combination on my system -- at least I
didn't find one.
then typing 'keys' and hitting return.

Ooh. Now that trick I did not know about. (I had been navigating
to Keys and -- click, ick. :) )
The textbox at the
top of the page lets you search for commands by name; i don't think
there's a way to search by keystroke. You can then see what's bound, and
add bindings for things which aren't. There's a little window which shows
you any conflicts with bindings you add. You can set the context in which
they keystroke is bound; i believe 'In Windows' means it's bound
everywhere.
From this, i can see that, on the Mac, command-F8 selects the next
perspective, and shift-command-F8 the previous one.

Yes, this is the one (s/command/control/ for Linux) I remembered ....
Huh. I just tried it again, and it worked. What I'm vaguely
remembering is that it sometimes it did and sometimes it didn't,
and I couldn't figure out why, and gave up. Huh.
There are a set of
'Show Perspective (foo)' commands for all the perspectives (do not be
seduced by the commands called simply 'Java' and 'Java Browsing' - they
are false idols). On my machine, command-F1 to command-F6 are not bound
(in Eclipse), so they could be used.

Toggle breakpoint is command-shift-B. Open breakpoint properties (but only
when in the breakpoints view) is option-return.

Huh. That does sound vaguely familiar, and it's what the "Keys"
preferences page says too (though s/command/control/), but when
I try using this key combination in an editor window, it inserts
a 'B'.
 
B

blmblm

[ snip ]

And judging by your response [1] to one of Lew's posts, I think I
know -- well, I'm not sure I'd be able to list all the names you've
used, but it appears that my guess about identity was correct.

[1] "None of the nasty things ...."

So, tempting though it might be to continue to try to explain
myself, and to correct some of your misimpressions about "screen",
experience [2] suggests that at most two people might actually be
interested in such a discussion, and it might easily expand into
something that would annoy other participants. So I'll try to
resist temptation.

[2] Long-time readers may remember a previous discussion (and will
probably *not* be thanking anyone for the memories).

[ snip ]
 
E

Eight of Seventeen

Ooh.  Now that trick I did not know about.  (I had been navigating
to Keys and -- click, ick.  :)  )

And there it is again. That peculiar mouse allergy that seems to be an
unpleasant side effect of chronic Unix exposure.

Does the mouse work much more poorly in X than in "real" Windows,
perhaps, leading to a lifelong aversion?
 
E

Eight of Seventeen


And judging by your response [1] to one of Lew's posts, I think I
know -- well, I'm not sure I'd be able to list all the names you've
used, but it appears that my guess about identity was correct.

What does that have to do with Java, screen, vi, or any of the other
topics of this thread?
So, tempting though it might be to continue to try to explain
myself, and [insult deleted]

No! None of the nasty things that you have said or implied about me
are at all true.
experience [2] suggests that at most two people might actually be
interested in such a discussion,

An unsubstantiated claim.
and it might easily expand into something that would annoy other participants.
 So I'll try to resist temptation.

[2] Long-time readers may remember a previous discussion (and [implied insult
deleted]).

No. None of the nasty things that you have said or implied about me
are at all true.
 
T

Tom Anderson

Huh. That does sound vaguely familiar, and it's what the "Keys"
preferences page says too (though s/command/control/), but when I try
using this key combination in an editor window, it inserts a 'B'.

Hmm. It's either bound to a subtly wrong context, or you have biscuit
crumbs stuck under the control keycap.

tom
 
B

blmblm

Hmm. It's either bound to a subtly wrong context, or you have biscuit
crumbs stuck under the control keycap.

The latter explanation, taken literally, is pretty unlikely, and
in any case the control key seems to work okay in other contexts.
The entry in the "Keys" preferences page has

Command "Toggle breakpoint"

Binding "Shift+Ctrl+B"

When "In Windows"

Category "Run/Debug"

User ""

Huh. Another mystery, maybe.
 
B

blmblm


[ snip ]
Yes, this is the one (s/command/control/ for Linux) I remembered ....
Huh. I just tried it again, and it worked. What I'm vaguely
remembering is that it sometimes it did and sometimes it didn't,
and I couldn't figure out why, and gave up. Huh.

Curiouser and curiouser ....

Apparently indeed sometimes it works and sometimes it doesn't.
On a quick test -- invoke "synchronize with repository" from the
context menu, let it switch to the CVS perspective, then switch
back to the Java perspective -- control-F8 works as desired.
However, recently I switched to the CVS perspective, did some
things (reviewed changes and committed them), and tried to switch
back to the Java perspective, and .... Nothing. control-F8 did
nothing, and neither did control-F7. I did discover that there's
a Navigate submenu under Window that offers a "next perspective"
option, and *that* works, and it can be done from the keyboard,
which is good to know.

But "sometimes it works and sometimes it doesn't" is a bit --
puzzling? bothersome?

[ snip ]
 
F

Four of Seventeen

[ snip ]
If I do a "synchronize with repository" operation and let Eclipse switch
to the CVS perspective or view or whatever it is (I have trouble
remembering which of those is which), I haven't figured out how to
easily get back to the "normal" (Java) view, other than clicking a
little ">>" button near the upper right corner to display a list of
other whatever-they-are.  I did find a keyboard shortcut (control-f8
IIRC) that *seemed* like it would do what I want, but I can't seem to
make it work.  I could be mistaken.

[ snip ]
Yes, this is the one (s/command/control/ for Linux) I remembered ....  
Huh.  I just tried it again, and it worked.  What I'm vaguely
remembering is that it sometimes it did and sometimes it didn't,
and I couldn't figure out why, and gave up.  Huh.

Curiouser and curiouser ....

Apparently indeed sometimes it works and sometimes it doesn't.
On a quick test -- invoke "synchronize with repository" from the
context menu, let it switch to the CVS perspective, then switch
back to the Java perspective -- control-F8 works as desired.
However, recently I switched to the CVS perspective, did some
things (reviewed changes and committed them), and tried to switch
back to the Java perspective, and ....  Nothing.  control-F8 did
nothing, and neither did control-F7.  I did discover that there's
a Navigate submenu under Window that offers a "next perspective"
option, and *that* works, and it can be done from the keyboard,
which is good to know.

But "sometimes it works and sometimes it doesn't" is a bit --
puzzling?  bothersome?

Now you know how the rest of us feel when we try to use vi or emacs
and things behave ... strangely, and change in unpredictable-to-us
ways, like, say, "enter" in emacs sometimes inserting a newline into
the displayed text but sometimes acting more like clicking a link in a
web browser. :)

I'm not sure if this results from "trying to do everything with the
keyboard, instead of using the keyboard for keyboardy things like
entering text and the mouse for mousy things like long-range
navigation and issuing commands" or from "trying to cram every kind of
application feature from every kind of application into one text
editor input pane" or both, though. :)
 
B

blmblm

[ snip ]
So, tempting though it might be to continue to try to explain
myself, and [insult deleted]

No! None of the nasty things that you have said or implied about me
are at all true.
experience [2] suggests that at most two people might actually be
interested in such a discussion,

An unsubstantiated claim.

s/suggests/suggests to me/ and it doesn't need substantiation.

Notice, however, that no one else seems to be clamoring for more
in this thread -- unless the lurkers are supporting you in e-mail.

[ snip ]
 
B

blmblm

(Are you related to that Eight of Seventeen fellow? Huh.)

[ snip ]
Now you know how the rest of us feel when we try to use vi or emacs
and things behave ... strangely, and change in unpredictable-to-us
ways, like, say, "enter" in emacs sometimes inserting a newline into
the displayed text but sometimes acting more like clicking a link in a
web browser. :)

People are sometimes perplexed by the behavior of tools they don't
understand very well. Was that your point? It doesn't seem very
newsworthy.

However, it seems to me that someone who understands the tool well
should be able to explain the behavior that the novice-to-intermediate
user finds perplexing. I'm fairly sure an emacs expert could explain
the behavior you describe. Perhaps at some point an Eclipse expert
will be along to explain the behavior I describe.
I'm not sure if this results from "trying to do everything with the
keyboard, instead of using the keyboard for keyboardy things like
entering text and the mouse for mousy things like long-range
navigation and issuing commands" or from "trying to cram every kind of
application feature from every kind of application into one text
editor input pane" or both, though. :)

Because of course what you describe can't possibly be attributed to
PEBKAC, right?
 
F

Four of Seventeen

(Are you related to that Eight of Seventeen fellow?  Huh.)

We are Borg.
Now you know how the rest of us feel when we try to use vi or emacs
and things behave ... strangely, and change in unpredictable-to-us
ways, like, say, "enter" in emacs sometimes inserting a newline into
the displayed text but sometimes acting more like clicking a link in a
web browser. :)

People are sometimes perplexed by the behavior of tools they [implied
insult deleted]

No. None of the nasty things that you have said or implied about me
are at all true.

Though, that said, it is noteworthy that some tools seem to go out of
their way to be difficult for a novice user (even one who's a computer
expert in general and merely new to those particular tools) to
understand.
However, it seems to me that someone who understands the tool well
should be able to explain the behavior that the novice-to-intermediate
user finds perplexing.

Obviously, when the novice-to-intermediate user (of that tool) finds
such explanations equally perplexing, illogical, or just plain wonky,
then the problems go deeper.
 I'm fairly sure an emacs expert could explain the behavior you describe..

I'm fairly sure a self-described emacs expert has tried, and failed.
Most likely the only explanation for the behavior I describe involves
an emacs developer, severe sleep deprivation, and one or more
psychopharmacological substances of questionable legality.
 Perhaps at some point an Eclipse expert will be along to explain the
behavior I describe.

Probably. You will be assimilated. Resistance is futile.
Because of course what you describe can't possibly be attributed to
PEBKAC, right?

Certainly not in my own case. Others' mileage may vary, of course.
 
B

blmblm

[ snip ]
Yeah, maybe. I'll look some more at my actual code.

What may matter, though, is that sometimes I want to immediately
pass the value returned by modified() to set(), while other times
I want to save the value returned by modified() locally, from where
it might or might not later be passed to set().

My most recent refactoring of the "real" code uses static generic
methods (as suggested somewhere upthread), and for now that seems
not-bad. I'll probably change my mind again at some point. :)?

And I did, so -- a very belated follow-up, for the record maybe ....

Eventually, after much rearranging of the furniture, I came
around to the idea that maybe it did make more sense to put the
desired functionality in GThing. In my "real" application I
wanted to be able to compute a possibly-temporary result and then
later optionally save it. What I ended up doing was storing the
possibly-temporary value in the GThing (rather than returning it
for the caller to keep track of) and adding a method to GThing to
save the possibly-temporary value. There are still some things
about this setup and how it fits into the overall application
that feel like ugly hacks, but the application does what I wanted
it to do, and at some point one has to say "good enough for now"
and move on, maybe.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top