StringBuilder Difficulties

S

supercalifragilisticexpialadiamaticonormalizeringe

On 7/6/2011 4:52 PM,
supercalifragilisticexpialadiamaticonormalizeringelimatisticantations wrote:
...
The foreach syntax can also be used with arrays, including arrays of
unboxed primitives, even though using reflection on an array (e.g. (new
Object[3]).getClass().getInterfaces();) only shows it implementing
Cloneable and Serializable, not Iterable.

The JLS says that the enhanced for statement expression "must either
have type Iterable or else it must be of an array type (§10.1), or a
compile-time error occurs."

[http://java.sun.com/docs/books/jls/third_edition/html/statements.html#14.14.2]

Patricia

YABT
 
S

supercalifragilisticexpialadiamaticonormalizeringe

// iterate over all elements of s -- this "foreach" syntax
// is possible AFAIK with all classes that implement Collection
for (Foo foo : s) {
// note use of C-like printf
System.out.printf("foo with value %d, hashcode %d\n",
foo.n, foo.hashCode());
}

In fact, it's possible with all classes that implement Iterable; the
Collection interface extends Iterable so you are correct, but it goes
further than just Collection.

The only classes in java.* and javax.* that implement it seem to
implement Collection (you'd think CharSequence as well, and perhaps even
Map and/or Enumeration or all the legacy classes that provide an
Enumeration, but no), but third party libraries can in principle
implement it separately.

The foreach syntax can also be used with arrays, including arrays of
unboxed primitives, even though using reflection on an array (e.g. (new
Object[3]).getClass().getInterfaces();) only shows it implementing
Cloneable and Serializable, not Iterable.
 
S

supercalifragilisticexpialadiamaticonormalizeringe

WTF???

I didn't post this.

Who's forging my from and why?

if I were you, Paul, I would write in a complaint!
X-Complaints-To: (e-mail address removed)

make it simple. small short words, there is a clue.
Like "I am a fuckhead who likes to **** with
newsgroups. This other fuckhead is fucking
up my fucking with newsgroups.
Ex-fucking-scuse me!
Can you help me to help the fuckhead fuckoff?"

make sure you sign it "Paul".
Paolo knows you are coming[pun]
 
S

supercalifragilisticexpialadiamaticonormalizeringe

supercali said:
The foreach syntax can also be used with arrays, including arrays of
unboxed primitives, even though using reflection on an array (e.g. (new
Object[3]).getClass().getInterfaces();) only shows it implementing
Cloneable and Serializable, not Iterable.

The JLS says that the enhanced for statement expression "must either
have type Iterable or else it must be of an array type (§10.1), or a
compile-time error occurs."

[http://java.sun.com/docs/books/jls/third_edition/html/statements.html#14.14.2]

Patricia

YABT

WTF? I didn't write that. And what does "YABT" even mean?

Why are posts appearing in this newsgroup with my name on them that I
didn't write???
 
S

supercalifragilisticexpialadiamaticonormalizeringe

if I were you, Paul, I would write in a complaint!

Who the hell is Paul?
make it simple. small short words, there is a clue.

Now you're being rude. Why don't you a) get your own from line and quit
using someone else's and b) talk about Java, or else c) get the **** off
the 'net, jerkoff?
Like "I am a fuckhead who likes to **** with newsgroups. This other
fuckhead is fucking up my fucking with newsgroups. Ex-fucking-scuse me!
Can you help me to help the fuckhead fuckoff?"

make sure you sign it "Paul". Paolo knows you are coming[pun]

What the hell are you babbling on about now? Have you been drinking or
something? You're not making an ounce of sense and you're obviously not
oriented to place or person, since this is a Java newsgroup and there
are no Pauls or Paolos here but you're babbling on about some people
with those names and not saying anything about Java.
 
S

supercalifragilisticexpialadiamaticonormalizeringe

Like "I am a fuckhead who likes to **** with newsgroups. This other
fuckhead is fucking up my fucking with newsgroups. Ex-fucking-scuse me!
Can you help me to help the fuckhead fuckoff?"

make sure you sign it "Paul". Paolo knows you are coming[pun]

What the hell are you babbling on about now?

You really are attached to this st00pid fucking name!
Complain to Paolo, Paul.
He wants you to be there for him.

SNAAAAAAAAAAAAARF
 
S

supercalifragilisticexpialadiamaticonormalizeringe

supercali said:
On 7/6/2011 4:52 PM,
supercali ... wrote:
The foreach syntax can also be used with arrays, including arrays of
unboxed primitives, even though using reflection on an array (e.g. (new
Object[3]).getClass().getInterfaces();) only shows it implementing
Cloneable and Serializable, not Iterable.

The JLS says that the enhanced for statement expression "must either
have type Iterable or else it must be of an array type (§10.1), or a
compile-time error occurs."

[http://java.sun.com/docs/books/jls/third_edition/html/statements.html#14.14.2]

Patricia

YABT

WTF? I didn't write that. And what does "YABT" even mean?
Go fetch it yourself you lazy fat ****!
http://www.acronymfinder.com/KP~3.html
Why are posts appearing in this newsgroup with my name on them that I
didn't write???
oH did you not?
bummer that!

SNNNAAAAAAAAAAAAAAAAAAAAAAAARRRRRFFF
 
T

thoolen

On 06/07/2011 8:43 AM, eye forged my From and wrote:
67> Newsgroups: comp.lang.java.programmer

67> %^#*Q^%^#*Q^$*#! classic unsubstantiated and erroneous claim
67> %^#*Q^$*#! with Java, eye?

Suffering from line noise, eye?

67> Silvio's post is itself good advice and quite
67> reasonable, eye.

Why are you telling yourself what I already told you, eye?

67> %^#*Q^%^#*Q^$*#! racist opinion %^#*Q^$*#! with Java, eye?

Still suffering from line noise, eye?

67> I am "Derbyshire", eye?

Why are you asking yourself if you are "Derbyshire", eye? Suffering from
an identity crisis, eye?

67> %^#*Q^$666 in this newsgroup using that alias.

Still suffering from line noise, eye?

67> %^#*Q^$*#! "Paul", eye? %^#*Q^$666 in this newsgroup %^#*Q^$666

Still suffering from line noise, eye?

67> %^#*Q^$ %^#*Q^$*#! laundering operation %^#*Q^$*#! with
67> Java, eye?

Still suffering from line noise, eye?

67> %^#*Q^%^#*Q^$*#! bad advice %^#*Q^$*#! with Java, eye?

Still suffering from line noise, eye?

67> First I make a slur against the Dutch, then ask for
67> killfiling all users of a particular internet service
67> provider. I suffer from bigotry problems, yes?

Apparently, eye. Have you sought help for these problems yet, eye? And
what do your ongoing bigotry problems have to do with Java, eye?

67> %^#*Q^%^#*Q^$*#! haunting of newsgroups %^#*Q^$*#! with
67> Java, eye?

Still suffering from line noise, eye?

67> %^#*Q^%^#*Q^$*#! message %^#*Q^$*#! with Java, eye?

Still suffering from line noise, eye?

67> As I'm sitting on my ass laughing like an off-topic flame
67> and racist inciting asshole it is my hatred, targeted at
67> an absentee victim and posted where it's neither welcome
67> nor relevant.

What does your hatred of the Dutch have to do with Java, eye?

67> I am expert at this function of madness.

What does your long familiarity with your own madness have to do with
Java, eye? Your psychologist's couch would be a more appropriate venue
than this newsgroup, eye.

And get yourself a modem that works properly.
 
T

thoolen

On 06/07/2011 8:26 AM, Stefan Robacki forged my From line and wrote:
32> Newsgroups: comp.lang.java.programmer

32> %^#*&^L!&** %^#* trolling %^#*&^L!&** with Java, Robacki?

Still suffering from line noise, Robacki? As I said in response to your
similarly mangled forgery in comp.lang.lisp, get yourself a new modem
because yours is obviously dying by inches.

32> Who are "Paul Derbyshire" and "Seamus McRae", Robacki?

You should know, since you're the one who brought those names up in
conversation, Robacki.

32> %^#*&^L!&** in this newsgroup %^#*&^L!&** either alias.

Still suffering from line noise, Robacki?

32> %^#*&^L!&** "Paul", Robacki? %^#*&^L!&** in this newsgroup
32> %^#*&^L!&** that alias.

Still suffering from line noise, Robacki?

32> %^#*&^L!&** %^#* classic unsubstantiated and erroneous claim
32> %^#*&^L!&** with Java, Robacki?

Still suffering from line noise, Robacki?

32> The only thing you have posted to comp.lang.lisp is
32> an off-topic troll nearly identical to this one, Robacki.

Why are you telling yourself that, Robacki? Suffering from an identity
crisis, Robacki?

32> What about KitKat's on-topic post regarding Java object monitors,
32> Robacki?

You tell me. You're the one who posted that quotation from KitKat's post.

32> Unless you mean to point to an example of useful and good-faith
32> participation in this newsgroup to contrast with %^#* own
"contribution"
32> here of an off-topic troll, Robacki.

Still suffering from line noise, Robacki?

32> %^#*&^L!&** "this chap", Robacki? %^#*&^L!&** in this newsgroup
32> %^#*&^L!&** that alias.

Still suffering from line noise, Robacki?

32> %^#*&^L!&** %^#* harmless craziness %^#*&^L!&** with Java, Robacki?

Still suffering from line noise, Robacki?

32> %^#*&^L!&** %^#* ridiculously long URL %^#*&^L!&** with Java,
32> Robacki?

Still suffering from line noise, Robacki?

32> %^#*Q^$ the names of two English towns %^#*&^L!&** with Java,
32> Robacki?

Still suffering from line noise, Robacki?

32> %^#*&^L!&** "Paul Derbyshire", Robacki? %^#*&^L!&** in this newsgroup
32> %^#*&^L!&** that alias.

Still suffering from line noise, Robacki?

32> %^#*&^L!&** "Nebulous", Robacki? %^#*&^L!&** in this newsgroup
32> %^#*&^L!&** that alias.

Still suffering from line noise, Robacki?

32> %^#*&^L!&** "Jerry Gerrone", Robacki? %^#*&^L!&** in this newsgroup
32> %^#*&^L!&** that alias.

Still suffering from line noise, Robacki?

32> %^#*&^L!&** "Extravagan", Robacki? %^#*&^L!&** in this newsgroup
32> %^#*&^L!&** that alias.

Still suffering from line noise, Robacki?

32> %^#*&^L!&** "De Lurker", Robacki? %^#*&^L!&** in this newsgroup
32> %^#*&^L!&** that alias.

Still suffering from line noise, Robacki?

32> %^#*&^L!&** "Sulfide Eater", Robacki? %^#*&^L!&** in this newsgroup
32> %^#*&^L!&** that alias.

Still suffering from line noise, Robacki?

32> %^#*&^L!&** "Series Expansion", Robacki? %^#*&^L!&** in this newsgroup
32> %^#*&^L!&** that alias.

Still suffering from line noise, Robacki?

32> %^#*&^L!&** "Spock", Robacki? %^#*&^L!&** in this newsgroup
32> %^#*&^L!&** that alias. Perhaps %^#*&^L!&**in the movie theater or
32> on TV %^#*&^L!&** in comp.lang.java.programmer, Robacki.

Still suffering from line noise, Robacki?

32> %^#*&^L!&** "Orange Green", Robacki? %^#*&^L!&** in this newsgroup
32> %^#*&^L!&** that alias.

Still suffering from line noise, Robacki?

32> %^#*&^L!&** "Willy Wonka", Robacki? %^#*&^L!&** in this newsgroup
32> %^#*&^L!&** that alias. Perhaps %^#*&^L!&**in the book store
32> %^#*&^L!&** in comp.lang.java.programmer, Robacki.

Still suffering from line noise, Robacki?

32> %^#*&^L!&** that %^#*&^L!&** with Java, Robacki?

Still suffering from line noise, Robacki?

32> %^#*&^L!&** "Zapotec", Robacki? %^#*&^L!&** in this newsgroup
32> %^#*&^L!&** that alias.

Still suffering from line noise, Robacki?

32> %^#*&^L!&** "Nancy 4", Robacki? %^#*&^L!&** in this newsgroup
32> %^#*&^L!&** that alias.

Still suffering from line noise, Robacki?

32> %^#*&^L!&** my email address %^#*&^L!&** with Java, Robacki?

Still suffering from line noise, Robacki?

32> %^#*&^L!&** "3x+rav4gan", Robacki? %^#*&^L!&** in this newsgroup
32> %^#*&^L!&** that alias.

Still suffering from line noise, Robacki?

32> %^#*&^L!&** KitKat's email address %^#*&^L!&** with Java, Robacki?

Still suffering from line noise, Robacki?

32> %^#*&^L!&** "Seamus MacRae", Robacki? %^#*&^L!&** in this newsgroup
32> %^#*&^L!&** that alias.

Still suffering from line noise, Robacki?

Seek technical and professional help, Robacki. Before it's too late.
 
S

supercalifragilisticexpialadiamaticonormalizeringe

1> Newsgroups: comp.os.os2.advocacy

1> Possible, sure. Although the M.O. of "super" doesn't really match
1> Paul's much, imo. Maybe we've trolled even if it's not Paul.

The M.O. of "Stefan Robacki" matches those of Tim Harrison, Sulfide
Eater, Chad Carmichael, Extravagan, Meerkats, Purpleswandir, Heike
Svensson, Derek Yancey, Zxcvbnm, Greg Kelly, Willy Wonka, Nougat
Surprise, Mister Whiskers, John Harbl, Alice, Cthun, Boojum, Katie
Gerrolds, Julie Faramis, Henry Harrison, Nancy 4, and
supercalifragilisticexpialadiamaticonormalizeringelimatisticantations,
markspace.

Hey, what?! Why am I in this list?
Why not just spot the NNTP-Posting-Host, markspace?

Lots of people use AIOE, tholen. You're crazy if you think that will
identify individual, separate posters. If AIOE put an IP address into
that header, perhaps, but it doesn't.
 
S

supercalifragilisticexpialadiamaticonormalizeringe

On 06/07/2011 8:54 PM, Paul Derbyshire - Pembroke[ontario.ca] wrote

No, he didn't, I did.
Go fetch it yourself you lazy fat ****!

ExCUSE me?

What the hell is the matter with you, and why don't you think up your
own handle and stop using mine to post profanity and flames!
oH did you not?
bummer that!

You, sir, have an attitude problem.

Get your own From line.

Get your attitude adjusted.

Get the hell out of cljp.
 
S

supercalifragilisticexpialadiamaticonormalizeringe

Like "I am a fuckhead who likes to **** with newsgroups. This other
fuckhead is fucking up my fucking with newsgroups. Ex-fucking-scuse me!
Can you help me to help the fuckhead fuckoff?"

make sure you sign it "Paul". Paolo knows you are coming[pun]

What the hell are you babbling on about now?

You really are attached to this st00pid fucking name!

If you think it's so stupid, why do you love it so much you insist on
using it instead of inventing your own handle to use here, huh?
Complain to Paolo, Paul.

Who the hell are Paolo and Paul?
He wants you to be there for him.

Who are you talking about. It sounds like you think I'm gay. Sorry, so
totally not. If THAT's what you're looking for, you're barking up the
wrong tree.
SNAAAAAAAAAAAAARF

What is that? You sound like a dog. And act like a dog that wants to
keep following someone around and humping their leg.

In which case:

Beat it, mutt, before I call the pound.
 
S

Steve Erwin

supercalifxxxxPaul Derbyshire - Pembroke Ontario CA
Like "I am a fuckhead who likes to **** with newsgroups. This other
fuckhead is fucking up my fucking with newsgroups. Ex-fucking-scuse me!
Can you help me to help the fuckhead fuckoff?"

make sure you sign it "Paul". Paolo knows you are coming[pun]

What the hell are you babbling on about now?

You really are attached to this st00pid fucking name!

If you think it's so stupid, why do you love it so much you insist on
using it instead of inventing your own handle to use here, huh?
Complain to Paolo, Paul.

Who the hell are Paolo and Paul?
He wants you to be there for him.

Who are you talking about. It sounds like you think I'm gay. Sorry, so
totally not. If THAT's what you're looking for, you're barking up the
wrong tree.
SNAAAAAAAAAAAAARF

What is that? You sound like a dog. And act like a dog that wants to
keep following someone around and humping their leg.

In which case:

Beat it, mutt, before I call the pound.
You make very very sure they bring
you a very small dog, Paul These balls
of yours are not so huge a feed for
a dachshund!

PML

You are a fucked duck, Paul.
 
S

supercalifragilisticexpialadiamaticonormalizeringe

supercalifxxxxPaul Derbyshire - Pembroke Ontario CA

What the **** is that? Your newsreader broken, dipshit?
You make very very sure they bring
you a very small dog, Paul These balls
of yours are not so huge a feed for
a dachshund!

Threats? If I ever see Paul I'll make sure to let him know about them.
Maybe you'll get lucky and he won't press charges. At least now you seem
to have gotten yourself your own handle, Mr. Erwin.

What the **** does that mean, Mr. Erwin?
You are a fucked duck, Paul.

Who is Paul and why are you obsessed with him, and why do you keep
making these garbled, irrelevant followups to my posts?
 
B

blmblm

On 6 Jul 2011 16:59:57 GMT, (e-mail address removed)

[snip]
Gene seems to be saying elsethread that in his real code he might
be initializing from something that isn't in order. But assuming he
Yup.

could put it in order before initializing the set, then yes, it seems

Why bother? SortedSet does the work for me.

If you care enough about performance to have put some effort
into benchmarking various approaches, I'd have thought you'd be
interested in one that seems to be significantly faster and almost
as simple to set up and use. (Probably -- I guess it depends on
how, in your real code, you'll be initializing the set.)

I'm not unsympathetic, though, to a desire to move on once
an acceptable solution has been found. "Just sayin'", maybe.
like a LinkedHashSet would do what he wants.

[snip]
 
B

blmblm

On 7/6/2011 4:52 PM,
supercalifragilisticexpialadiamaticonormalizeringelimatisticantations wrote:
...
The foreach syntax can also be used with arrays, including arrays of
unboxed primitives, even though using reflection on an array (e.g. (new
Object[3]).getClass().getInterfaces();) only shows it implementing
Cloneable and Serializable, not Iterable.

The JLS says that the enhanced for statement expression "must either
have type Iterable or else it must be of an array type (§10.1), or a
compile-time error occurs."

[http://java.sun.com/docs/books/jls/third_edition/html/statements.html#14.14.2]

Oh good -- someone else (two someone elses, between them) supplied
a better explanation than I did of the circumstances in which the
"foreach" syntax can be used. I wanted to mention it in case it
was of interest to Gene but was too lazy to do a proper job of
describing it.
 
G

Gene Wirchenko

On 6 Jul 2011 16:59:57 GMT, (e-mail address removed)

[snip]
Gene seems to be saying elsethread that in his real code he might
be initializing from something that isn't in order. But assuming he
Yup.

could put it in order before initializing the set, then yes, it seems

Why bother? SortedSet does the work for me.

If you care enough about performance to have put some effort
into benchmarking various approaches, I'd have thought you'd be
interested in one that seems to be significantly faster and almost
as simple to set up and use. (Probably -- I guess it depends on
how, in your real code, you'll be initializing the set.)

But why should I write code to sort something when SortedSet will
do it for me? Plus, if I output the contents of the set, having it in
sorted order makes more sense.

Remember that I am learning my way around Java. You may already
know how to do it quickly. For me, it would be another thing to find
and figure out. In time, in time.
I'm not unsympathetic, though, to a desire to move on once
an acceptable solution has been found. "Just sayin'", maybe.

Micro-optimisation is a nasty sin.

[snip]

Sincerely,

Gene Wirchenko
 
B

blmblm

On 6 Jul 2011 16:59:57 GMT, (e-mail address removed)

[snip]

Gene seems to be saying elsethread that in his real code he might
be initializing from something that isn't in order. But assuming he

Yup.

could put it in order before initializing the set, then yes, it seems

Why bother? SortedSet does the work for me.

If you care enough about performance to have put some effort
into benchmarking various approaches, I'd have thought you'd be
interested in one that seems to be significantly faster and almost
as simple to set up and use. (Probably -- I guess it depends on
how, in your real code, you'll be initializing the set.)

But why should I write code to sort something when SortedSet will
do it for me? Plus, if I output the contents of the set, having it in
sorted order makes more sense.

Remember that I am learning my way around Java. You may already
know how to do it quickly. For me, it would be another thing to find
and figure out. In time, in time.
I'm not unsympathetic, though, to a desire to move on once
an acceptable solution has been found. "Just sayin'", maybe.

Micro-optimisation is a nasty sin.

Yeah, yeah .... I guess it just seems strange to me that you went to
all the trouble of writing code to benchmark various approaches --
suggesting that sometimes you *do* engage in micro-optimization --
but are resistant to trying one more approach that (in my tests
anyway) sometimes reduced execution time by almost 50%. Just sayin',
"whatever", .... :)?
 
G

Gene Wirchenko

[snip]
Micro-optimisation is a nasty sin.

Yeah, yeah .... I guess it just seems strange to me that you went to
all the trouble of writing code to benchmark various approaches --
suggesting that sometimes you *do* engage in micro-optimization --
but are resistant to trying one more approach that (in my tests
anyway) sometimes reduced execution time by almost 50%. Just sayin',
"whatever", .... :)?

It should be obvious to you why someone might do that.

The part that I was benchmarking is critical to my program. It
is repeatedly used since it is called for every non-newline character
in a file. Initialising a set of characters does not happen nearly so
often.

Sincerely,

Gene Wirchenko
 

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

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top