Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #5757 > unrolled thread

StringBuilder Difficulties

Started byGene Wirchenko <genew@ocis.net>
First post2011-06-28 17:54 -0700
Last post2011-06-29 18:32 -0700
Articles 18 on this page of 98 — 25 participants

Back to article view | Back to comp.lang.java.programmer


Contents

  StringBuilder Difficulties Gene Wirchenko <genew@ocis.net> - 2011-06-28 17:54 -0700
    Re: StringBuilder Difficulties Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-06-28 21:29 -0400
      Re: StringBuilder Difficulties Lew <noone@lewscanon.com> - 2011-06-29 00:48 -0400
        Re: StringBuilder Difficulties Gene Wirchenko <genew@ocis.net> - 2011-06-29 12:19 -0700
      Re: StringBuilder Difficulties Gene Wirchenko <genew@ocis.net> - 2011-06-29 12:11 -0700
        Re: StringBuilder Difficulties Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-06-29 22:06 -0400
    Re: StringBuilder Difficulties blmblm@myrealbox.com <blmblm.myrealbox@gmail.com> - 2011-06-29 20:17 +0000
      Re: StringBuilder Difficulties Gene Wirchenko <genew@ocis.net> - 2011-06-29 18:55 -0700
        Re: StringBuilder Difficulties blmblm@myrealbox.com <blmblm.myrealbox@gmail.com> - 2011-06-30 20:30 +0000
          Re: StringBuilder Difficulties Patricia Shanahan <pats@acm.org> - 2011-06-30 14:17 -0700
            Re: StringBuilder Difficulties Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-06-30 21:36 -0400
              Re: StringBuilder Difficulties "John B. Matthews" <nospam@nospam.invalid> - 2011-07-01 01:41 -0400
          Re: StringBuilder Difficulties Gene Wirchenko <genew@ocis.net> - 2011-06-30 14:26 -0700
            Re: StringBuilder Difficulties Steve Sobol <sjsobol@JustThe.net> - 2011-06-30 17:33 -0700
            Re: StringBuilder Difficulties blmblm@myrealbox.com <blmblm.myrealbox@gmail.com> - 2011-07-01 20:47 +0000
              Re: StringBuilder Difficulties Gene Wirchenko <genew@ocis.net> - 2011-07-01 17:29 -0700
                Re: StringBuilder Difficulties rossum <rossum48@coldmail.com> - 2011-07-02 11:36 +0100
                Re: StringBuilder Difficulties Robert Klemme <shortcutter@googlemail.com> - 2011-07-02 12:58 +0200
                  Re: StringBuilder Difficulties Gene Wirchenko <genew@ocis.net> - 2011-07-04 07:52 -0700
                    Re: StringBuilder Difficulties Robert Klemme <shortcutter@googlemail.com> - 2011-07-04 21:45 +0200
                      Re: StringBuilder Difficulties supercalifragilisticexpialadiamaticonormalizeringelimatisticantations <supercalifragilisticexpialadiamaticonormalizeringelimatisticantations@averylongandannoyingdomainname.com> - 2011-07-05 02:06 -0400
                        Re: StringBuilder Difficulties markspace <-@.> - 2011-07-05 09:32 -0700
                          Re: StringBuilder Difficulties supercalifragilisticexpialadiamaticonormalizeringelimatisticantations <supercalifragilisticexpialadiamaticonormalizeringelimatisticantations@averylongandannoyingdomainname.com> - 2011-07-05 14:13 -0400
                            Re: StringBuilder Difficulties markspace <-@.> - 2011-07-05 12:51 -0700
                              Re: StringBuilder Difficulties Silvio <silvio@moc.com> - 2011-07-05 23:16 +0200
                                Re: StringBuilder Difficulties markspace <-@.> - 2011-07-05 15:08 -0700
                                  Re: StringBuilder Difficulties Silvio <silvio@moc.com> - 2011-07-06 09:41 +0200
                                    Re: StringBuilder Difficulties "eye" <eye@mocka.com> - 2011-07-06 09:55 +0000
                                      Re: StringBuilder Difficulties thoolen <thoolen@tholenbot.thorium> - 2011-07-06 05:37 -0400
                                      Re: StringBuilder Difficulties "thoolen" <thoolen@tholenbot.thorium> - 2011-07-06 08:43 -0400
                                        Re: StringBuilder Difficulties thoolen <thoolen@tholenbot.thorium> - 2011-07-06 22:30 -0400
                              Re: StringBuilder Difficulties "Stefan Robacki" <noemail@noemail.foobar> - 2011-07-06 00:04 -0400
                                Re: StringBuilder Difficulties thoolen <thoolen@tholenbot.thorium> - 2011-07-06 05:45 -0400
                                Re: StringBuilder Difficulties thoolen <thoolen@tholenbot.thorium> - 2011-07-06 08:26 -0400
                                  Re: StringBuilder Difficulties thoolen <thoolen@tholenbot.thorium> - 2011-07-06 22:36 -0400
                                Re: StringBuilder Difficulties "tholen@antispam.ham" <tholen@ifa.hawaii.edu> - 2011-07-06 06:09 -0700
                                  Re: StringBuilder Difficulties supercalifragilisticexpialadiamaticonormalizeringelimatisticantations <supercalifragilisticexpialadiamaticonormalizeringelimatisticantations@averylongandannoyingdomainname.com> - 2011-07-06 22:40 -0400
                                    Re: StringBuilder Difficulties John Doe <jdoe@usenetlove.invalid> - 2011-07-14 06:50 +0000
                                      Re: StringBuilder Difficulties supercalifragilisticexpialadiamaticonormalizeringelimatisticantations <supercalifragilisticexpialadiamaticonormalizeringelimatisticantations@averylongandannoyingdomainname.com> - 2011-07-14 02:58 -0400
                                        Re: StringBuilder Difficulties Jane Doe <jdoe@love.in.d.jungle.invalid> - 2011-07-14 10:20 -0400
                                          Re: StringBuilder Difficulties thoolen <tholen01@gmail.com> - 2011-07-14 07:33 -0700
                          Re: StringBuilder Difficulties Stanimir Stamenkov <s7an10@netscape.net> - 2011-07-05 23:44 +0300
                            Re: StringBuilder Difficulties markspace <-@.> - 2011-07-05 14:08 -0700
                Re: StringBuilder Difficulties blmblm@myrealbox.com <blmblm.myrealbox@gmail.com> - 2011-07-02 18:33 +0000
                  Re: StringBuilder Difficulties supercalifragilisticexpialadiamaticonormalizeringelimatisticantations <supercalifragilisticexpialadiamaticonormalizeringelimatisticantations@averylongandannoyingdomainname.com> - 2011-07-02 16:56 -0400
                  Re: StringBuilder Difficulties blmblm@myrealbox.com <blmblm.myrealbox@gmail.com> - 2011-07-03 01:34 +0000
                    Re: StringBuilder Difficulties Patricia Shanahan <pats@acm.org> - 2011-07-02 19:55 -0700
                      Re: StringBuilder Difficulties blmblm@myrealbox.com <blmblm.myrealbox@gmail.com> - 2011-07-04 03:32 +0000
                    Re: StringBuilder Difficulties Gene Wirchenko <genew@ocis.net> - 2011-07-04 08:04 -0700
                      Re: StringBuilder Difficulties blmblm@myrealbox.com <blmblm.myrealbox@gmail.com> - 2011-07-05 19:12 +0000
                        Re: StringBuilder Difficulties Gene Wirchenko <genew@ocis.net> - 2011-07-05 14:06 -0700
                          Re: StringBuilder Difficulties blmblm@myrealbox.com <blmblm.myrealbox@gmail.com> - 2011-07-05 21:16 +0000
                            Re: StringBuilder Difficulties Gene Wirchenko <genew@ocis.net> - 2011-07-05 17:29 -0700
                              Re: StringBuilder Difficulties blmblm@myrealbox.com <blmblm.myrealbox@gmail.com> - 2011-07-06 16:59 +0000
                                Re: StringBuilder Difficulties supercalifragilisticexpialadiamaticonormalizeringelimatisticantations <supercalifragilisticexpialadiamaticonormalizeringelimatisticantations@averylongandannoyingdomainname.com> - 2011-07-06 19:52 -0400
                                  Re: StringBuilder Difficulties Patricia Shanahan <pats@acm.org> - 2011-07-06 16:58 -0700
                                    Re: StringBuilder Difficulties supercalifragilisticexpialadiamaticonormalizeringelimatisticantations <supercalifragilisticexpialadiamaticonormalizeringelimatisticantations@averylongandannoyingdomainname.com> - 2011-07-06 19:52 -0400
                                      Re: StringBuilder Difficulties supercalifragilisticexpialadiamaticonormalizeringelimatisticantations <supercalifragilisticexpialadiamaticonormalizeringelimatisticantations@averylongandannoyingdomainname.com> - 2011-07-06 21:54 -0400
                                        Re: StringBuilder Difficulties supercalifragilisticexpialadiamaticonormalizeringelimatisticantations <supercalifragilisticexpialadiamaticonormalizeringelimatisticantations@averylongandannoyingdomainname.com> - 2011-07-06 22:18 -0400
                                          Re: StringBuilder Difficulties supercalifragilisticexpialadiamaticonormalizeringelimatisticantations <supercalifragilisticexpialadiamaticonormalizeringelimatisticantations@averylongandannoyingdomainname.com> - 2011-07-06 22:41 -0400
                                    Re: StringBuilder Difficulties blmblm@myrealbox.com <blmblm.myrealbox@gmail.com> - 2011-07-08 17:45 +0000
                            Re: StringBuilder Difficulties supercalifragilisticexpialadiamaticonormalizeringelimatisticantations <supercalifragilisticexpialadiamaticonormalizeringelimatisticantations@averylongandannoyingdomainname.com> - 2011-07-06 05:48 -0400
                              Re: StringBuilder Difficulties blmblm@myrealbox.com <blmblm.myrealbox@gmail.com> - 2011-07-06 16:59 +0000
                                Re: StringBuilder Difficulties Gene Wirchenko <genew@ocis.net> - 2011-07-06 10:56 -0700
                                  Re: StringBuilder Difficulties blmblm@myrealbox.com <blmblm.myrealbox@gmail.com> - 2011-07-08 17:44 +0000
                                    Re: StringBuilder Difficulties Gene Wirchenko <genew@ocis.net> - 2011-07-08 11:51 -0700
                                      Re: StringBuilder Difficulties blmblm@myrealbox.com <blmblm.myrealbox@gmail.com> - 2011-07-10 19:08 +0000
                                        Re: StringBuilder Difficulties Gene Wirchenko <genew@ocis.net> - 2011-07-11 07:54 -0700
                                          Re: StringBuilder Difficulties blmblm@myrealbox.com <blmblm.myrealbox@gmail.com> - 2011-07-11 22:37 +0000
                                            Re: StringBuilder Difficulties Gene Wirchenko <genew@ocis.net> - 2011-07-11 15:52 -0700
                            Re: StringBuilder Difficulties supercalifragilisticexpialadiamaticonormalizeringelimatisticantations <supercalifragilisticexpialadiamaticonormalizeringelimatisticantations@averylongandannoyingdomainname.com> - 2011-07-06 08:25 -0400
                              Re: StringBuilder Difficulties supercalifragilisticexpialadiamaticonormalizeringelimatisticantations <supercalifragilisticexpialadiamaticonormalizeringelimatisticantations@averylongandannoyingdomainname.com> - 2011-07-06 19:41 -0400
                                Re: StringBuilder Difficulties supercalifragilisticexpialadiamaticonormalizeringelimatisticantations <supercalifragilisticexpialadiamaticonormalizeringelimatisticantations@averylongandannoyingdomainname.com> - 2011-07-06 19:58 -0400
                                  Re: StringBuilder Difficulties supercalifragilisticexpialadiamaticonormalizeringelimatisticantations <supercalifragilisticexpialadiamaticonormalizeringelimatisticantations@averylongandannoyingdomainname.com> - 2011-07-06 21:57 -0400
                                    Re: StringBuilder Difficulties supercalifragilisticexpialadiamaticonormalizeringelimatisticantations <supercalifragilisticexpialadiamaticonormalizeringelimatisticantations@averylongandannoyingdomainname.com> - 2011-07-06 22:17 -0400
                                      Re: StringBuilder Difficulties supercalifragilisticexpialadiamaticonormalizeringelimatisticantations <supercalifragilisticexpialadiamaticonormalizeringelimatisticantations@averylongandannoyingdomainname.com> - 2011-07-06 22:44 -0400
                                        Re: StringBuilder Difficulties Steve Erwin <trollHunter@Usenet.4.usenetizens.org.invalid> - 2011-07-07 12:51 +1000
                                          Re: StringBuilder Difficulties supercalifragilisticexpialadiamaticonormalizeringelimatisticantations <supercalifragilisticexpialadiamaticonormalizeringelimatisticantations@averylongandannoyingdomainname.com> - 2011-07-06 23:02 -0400
                                            Re: StringBuilder Difficulties John Doe <jdoe@usenetlove.invalid> - 2011-07-14 06:32 +0000
                                              Re: StringBuilder Difficulties supercalifragilisticexpialadiamaticonormalizeringelimatisticantations <supercalifragilisticexpialadiamaticonormalizeringelimatisticantations@averylongandannoyingdomainname.com> - 2011-07-14 02:57 -0400
                                              Re: StringBuilder Difficulties Jane Doe <jdoe@love.in.d.jungle.invalid> - 2011-07-14 10:07 -0400
                                                Re: StringBuilder Difficulties thoolen <tholen01@gmail.com> - 2011-07-14 07:24 -0700
                  Re: StringBuilder Difficulties Gene Wirchenko <genew@ocis.net> - 2011-07-04 07:58 -0700
                    Re: StringBuilder Difficulties blmblm@myrealbox.com <blmblm.myrealbox@gmail.com> - 2011-07-05 19:09 +0000
                      Re: StringBuilder Difficulties KitKat <kitkat_11697@gmail.example.com> - 2011-07-05 15:15 -0400
                        Re: StringBuilder Difficulties blmblm@myrealbox.com <blmblm.myrealbox@gmail.com> - 2011-07-05 20:03 +0000
                      Re: StringBuilder Difficulties Gene Wirchenko <genew@ocis.net> - 2011-07-05 14:11 -0700
                        Re: StringBuilder Difficulties blmblm@myrealbox.com <blmblm.myrealbox@gmail.com> - 2011-07-06 16:55 +0000
        Re: StringBuilder Difficulties lewbloch <lewbloch@gmail.com> - 2011-07-03 00:08 -0700
          Re: StringBuilder Difficulties Robert Klemme <shortcutter@googlemail.com> - 2011-07-03 12:35 +0200
            Re: StringBuilder Difficulties lewbloch <lewbloch@gmail.com> - 2011-07-04 04:07 -0700
    Re: StringBuilder Difficulties Patricia Shanahan <pats@acm.org> - 2011-06-29 14:38 -0700
      Re: StringBuilder Difficulties Gene Wirchenko <genew@ocis.net> - 2011-06-29 15:00 -0700
        Re: StringBuilder Difficulties Patricia Shanahan <pats@acm.org> - 2011-06-29 15:52 -0700
          Re: StringBuilder Difficulties Gene Wirchenko <genew@ocis.net> - 2011-06-29 18:58 -0700
            Re: StringBuilder Difficulties Patricia Shanahan <pats@acm.org> - 2011-06-29 19:26 -0700
            Re: StringBuilder Difficulties lewbloch <lewbloch@gmail.com> - 2011-07-03 00:11 -0700
    Re: StringBuilder Difficulties Roedy Green <see_website@mindprod.com.invalid> - 2011-06-29 18:32 -0700

Page 5 of 5 — ← Prev page 1 2 3 4 [5]


#6189

FromJane Doe <jdoe@love.in.d.jungle.invalid>
Date2011-07-14 10:07 -0400
Message-ID<4e1ef80e$0$13439$c3e8da3$aae71a0a@news.astraweb.com>
In reply to#6179
John Doe <jdoe@usenetlove.invalid>, wrote:

>>supercalifxxxxPaul Derbyshire - Pembroke Ontario CA  wrote: 
>
>> On 06/07/2011 10:51 PM, Steve Erwin wrote: 
>>> supercalifxxxxPaul Derbyshire - Pembroke Ontario CA 
>> 
>> What the fuck is that? 
>
>Looks like an effort to shorten your obnoxious ID, asshole. 

the worm hath shrunk and is now lost for words, in public.

>
>> 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? 
>
>Are you new to UseNet, asshole? 
>
with more than 4 kooksoots threatened by Derbyshire at netizens
I would say he is new at being run up the pole post being
caught "at it".

>> 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. 
>
>Moron.
>
Mirror Man.
the witch in the fairytale has nothing on the 
Derbyshire act.

>> At least now you seem to have gotten yourself your own handle,
>> Mr. Erwin. 
>> 
>>> PML 
>> 
>> What the fuck 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? 
>
>Says an asshole who appears to be a nym-shifting troll. 
>

do not worry about any libel action being brought by the
Derbyshire asshole. no need to pull your words, Derbyshire IS
a nym shifting troll. and has been for quite some 
time, as a matter of art.
elsewhere it is looking like he has set up his own 
little flame war in a private place involving hundreds 
of people. this because in his view Usenet is "too light".


we got a psychotic here in Derbyshire script.
hide the knives!

[toc] | [prev] | [next] | [standalone]


#6191

Fromthoolen <tholen01@gmail.com>
Date2011-07-14 07:24 -0700
Message-ID<830a48c9-1777-4461-9e1d-28a58bf63a57@s17g2000yqs.googlegroups.com>
In reply to#6189
On Jul 14, 10:07 am, Jane Doe <jdoe@love.in.d.jungle.invalid> wrote:
1> John Doe <jdoe@usenetlove.invalid>, wrote:
1> >>supercalifxxxxPaul Derbyshire - Pembroke Ontario CA  wrote:

John Doe didn't write that, Doe, yet you attributed it to him anyway.
Classic dishonesty on your part, Doe.

1> the worm hath shrunk and is now lost for words, in public.

Who is "the worm", Doe? There is nobody in this newsgroup using that
alias.

1> with more than 4 kooksoots threatened by Derbyshire at netizens
1> I would say he is new at being run up the pole post being
1> caught "at it".

Who is "Derbyshire", Doe? There is nobody in this newsgroup using that
alias.

1> Mirror Man.

Who is "Mirror Man", Doe? There is nobody in this newsgroup using that
alias.

1> the witch in the fairytale has nothing on the
1> Derbyshire act.

Who is "Derbyshire", Doe? There is nobody in this newsgroup using that
alias.

1> do not worry about any libel action being brought by the
1> Derbyshire asshole.

Who is "the Derbyshire asshole", Doe? There is nobody in this
newsgroup using that alias.

1> no need to pull your words, Derbyshire IS
1> a nym shifting troll. and has been for quite some
1> time, as a matter of art.

Who is "Derbyshire", Doe? There is nobody in this newsgroup using that
alias.

1> elsewhere it is looking like he has set up his own
1> little flame war in a private place involving hundreds
1> of people.

What does your classic inconsistency have to do with Java, Doe?

1> this because in his view Usenet is "too light".

What does your view of Usenet have to do with Java, Doe?

1> we got a psychotic here in Derbyshire script.

Who is "Derbyshire", Doe? There is nobody in this newsgroup using that
alias.

1> hide the knives!

What does your advice to John Doe have to do with Java, Doe?

[toc] | [prev] | [next] | [standalone]


#5850

FromGene Wirchenko <genew@ocis.net>
Date2011-07-04 07:58 -0700
Message-ID<0uk317l9064bd4uaa8m8tckpvks41d7jti@4ax.com>
In reply to#5822
On 2 Jul 2011 18:33:52 GMT, blmblm@myrealbox.com
<blmblm.myrealbox@gmail.com> wrote:

>In article <e9ps07h56utkftkp8fcarm7uhkk5t999le@4ax.com>,
>Gene Wirchenko  <genew@ocis.net> wrote:

[snip]

>>      Oh, I asked about that.  One apparently can not pass a function
>> pointer parameter as in C.  The ways that were posted involved lookup
>> every time AFIACS and I judged that it might swamp what I was
>> measuring (checking if a character were in a set).  So, to my chagrin,
>> I had to go with cut-and-paste.
>
>Without experimenting to find out, of course ....  

     You are putting the cart before the horse.

     THE WHOLE POINT of this exercise was experimentation to test the
speed of the lookup.  Until I got the code I was asking about running,
of course, I would not know.

[snip]

>>      I am pretty much past the intro stage and into the pain stage
>> where there is not so much help.
>
>That people are not willing to offer further help when many of their
>previous suggestions have been rejected should not be a total surprise.
><shrug>

     My phrase "not so much help" does not refer to this newsgroup.
You can find texts and Websites on starting with Java.  There is also
advanced material.  In the middle is a sour spot.  I am at the low end
of that sour spot.

Sincerely,

Gene Wirchenko

[toc] | [prev] | [next] | [standalone]


#5862

Fromblmblm@myrealbox.com <blmblm.myrealbox@gmail.com>
Date2011-07-05 19:09 +0000
Message-ID<97h5rqFhaeU2@mid.individual.net>
In reply to#5850
In article <0uk317l9064bd4uaa8m8tckpvks41d7jti@4ax.com>,
Gene Wirchenko  <genew@ocis.net> wrote:
> On 2 Jul 2011 18:33:52 GMT, blmblm@myrealbox.com
> <blmblm.myrealbox@gmail.com> wrote:
> 
> >In article <e9ps07h56utkftkp8fcarm7uhkk5t999le@4ax.com>,
> >Gene Wirchenko  <genew@ocis.net> wrote:
> 
> [snip]
> 
> >>      Oh, I asked about that.  One apparently can not pass a function
> >> pointer parameter as in C.  The ways that were posted involved lookup
> >> every time AFIACS and I judged that it might swamp what I was
> >> measuring (checking if a character were in a set).  So, to my chagrin,
> >> I had to go with cut-and-paste.
> >
> >Without experimenting to find out, of course ....  
> 
>      You are putting the cart before the horse.
> 
>      THE WHOLE POINT of this exercise was experimentation to test the
> speed of the lookup.  Until I got the code I was asking about running,
> of course, I would not know.


Maybe I misunderstood what you meant by "lookup" above --
I understood you to be referring to whatever has to be done
to find the method to be called, as opposed to looking up
individual characters in a list/set.  As far as I can tell,
your benchmark concerns different approaches to the latter,
but assumes that looking up the method (i.e., using the Java
substitute for function pointers) will somehow skew the results
to the point where it shouldn't/can't be used.  (You may actually
be right about that, much as it pains me to say so, because all
that duplicate code is, in my opinion and possibly yours as well,
both aesthetically displeasing and a source of potential trouble.)

> [snip]
> 
> >>      I am pretty much past the intro stage and into the pain stage
> >> where there is not so much help.
> >
> >That people are not willing to offer further help when many of their
> >previous suggestions have been rejected should not be a total surprise.
> ><shrug>
> 
>      My phrase "not so much help" does not refer to this newsgroup.
> You can find texts and Websites on starting with Java.  There is also
> advanced material.  In the middle is a sour spot.  I am at the low end
> of that sour spot.

Ah.  Interesting.  I don't seem to have a clear memory of how I got
from the beginning level to wherever I am now (intermediate?).  I do
remember, though, learning quite a bit from following semi-random
discussions in this newsgroup.  But that was, hm, a decade or so ago,
and it's not clear it would still work.  <shrug>

-- 
B. L. Massingill
ObDisclaimer:  I don't speak for my employers; they return the favor.

[toc] | [prev] | [next] | [standalone]


#5864

FromKitKat <kitkat_11697@gmail.example.com>
Date2011-07-05 15:15 -0400
Message-ID<iuvns0$c8o$1@speranza.aioe.org>
In reply to#5862
On 05/07/2011 3:09 PM, blmblm@myrealbox.com wrote:
> Ah.  Interesting.  I don't seem to have a clear memory of how I got
> from the beginning level to wherever I am now (intermediate?).  I do
> remember, though, learning quite a bit from following semi-random
> discussions in this newsgroup.

One single 8000-post semi-random discussion in this newsgroup, if the 
Giggle Gloops stats for your from address are to be believed.

[toc] | [prev] | [next] | [standalone]


#5868

Fromblmblm@myrealbox.com <blmblm.myrealbox@gmail.com>
Date2011-07-05 20:03 +0000
Message-ID<97h8voFbj6U1@mid.individual.net>
In reply to#5864
In article <iuvns0$c8o$1@speranza.aioe.org>,
KitKat  <kitkat_11697@gmail.example.com> wrote:
> On 05/07/2011 3:09 PM, blmblm@myrealbox.com wrote:
> > Ah.  Interesting.  I don't seem to have a clear memory of how I got
> > from the beginning level to wherever I am now (intermediate?).  I do
> > remember, though, learning quite a bit from following semi-random
> > discussions in this newsgroup.
> 
> One single 8000-post semi-random discussion in this newsgroup, if the 
> Giggle Gloops stats for your from address are to be believed.

Strictly speaking, those posts (if they're the ones I think you mean)
were made from a different address.  But the similarity between that
address and this one is deliberate -- myrealbox.com is no more, but
it seemed like a good idea to try to maintain some continuity.

Now, that discussion (again, if it's the one I think you mean)
was indeed quite educational, but little of it had anything to do
with Java.  The learning about Java of which I spoke happened
during the period of several years when I followed the group but
did not post to it.

-- 
B. L. Massingill
ObDisclaimer:  I don't speak for my employers; they return the favor.

[toc] | [prev] | [next] | [standalone]


#5873

FromGene Wirchenko <genew@ocis.net>
Date2011-07-05 14:11 -0700
Message-ID<68v61753v8gru9ugkpjmllusua9nvei9si@4ax.com>
In reply to#5862
On 5 Jul 2011 19:09:46 GMT, blmblm@myrealbox.com
<blmblm.myrealbox@gmail.com> wrote:

>In article <0uk317l9064bd4uaa8m8tckpvks41d7jti@4ax.com>,
>Gene Wirchenko  <genew@ocis.net> wrote:
>> On 2 Jul 2011 18:33:52 GMT, blmblm@myrealbox.com
>> <blmblm.myrealbox@gmail.com> wrote:
>> 
>> >In article <e9ps07h56utkftkp8fcarm7uhkk5t999le@4ax.com>,
>> >Gene Wirchenko  <genew@ocis.net> wrote:
>> 
>> [snip]
>> 
>> >>      Oh, I asked about that.  One apparently can not pass a function
>> >> pointer parameter as in C.  The ways that were posted involved lookup
>> >> every time AFIACS and I judged that it might swamp what I was
>> >> measuring (checking if a character were in a set).  So, to my chagrin,
>> >> I had to go with cut-and-paste.
>> >
>> >Without experimenting to find out, of course ....  
>> 
>>      You are putting the cart before the horse.
>> 
>>      THE WHOLE POINT of this exercise was experimentation to test the
>> speed of the lookup.  Until I got the code I was asking about running,
>> of course, I would not know.

>Maybe I misunderstood what you meant by "lookup" above --
>I understood you to be referring to whatever has to be done
>to find the method to be called, as opposed to looking up
>individual characters in a list/set.  As far as I can tell,

     It was the latter.

>your benchmark concerns different approaches to the latter,
>but assumes that looking up the method (i.e., using the Java
>substitute for function pointers) will somehow skew the results
>to the point where it shouldn't/can't be used.  (You may actually
>be right about that, much as it pains me to say so, because all
>that duplicate code is, in my opinion and possibly yours as well,
>both aesthetically displeasing and a source of potential trouble.)

     Well, I only need one.  That code will get tossed shortly.

>> [snip]
>> 
>> >>      I am pretty much past the intro stage and into the pain stage
>> >> where there is not so much help.
>> >
>> >That people are not willing to offer further help when many of their
>> >previous suggestions have been rejected should not be a total surprise.
>> ><shrug>
>> 
>>      My phrase "not so much help" does not refer to this newsgroup.
>> You can find texts and Websites on starting with Java.  There is also
>> advanced material.  In the middle is a sour spot.  I am at the low end
>> of that sour spot.
>
>Ah.  Interesting.  I don't seem to have a clear memory of how I got
>from the beginning level to wherever I am now (intermediate?).  I do
>remember, though, learning quite a bit from following semi-random
>discussions in this newsgroup.  But that was, hm, a decade or so ago,
>and it's not clear it would still work.  <shrug>

     In my experience, it is a common pattern.  After the beginner
level, there are few tutorials and yet, one does not know enough to
easily blow away the difficulties.

Sincerely,

Gene Wirchenko

[toc] | [prev] | [next] | [standalone]


#5909

Fromblmblm@myrealbox.com <blmblm.myrealbox@gmail.com>
Date2011-07-06 16:55 +0000
Message-ID<97jicdFr6pU1@mid.individual.net>
In reply to#5873
In article <68v61753v8gru9ugkpjmllusua9nvei9si@4ax.com>,
Gene Wirchenko  <genew@ocis.net> wrote:
> On 5 Jul 2011 19:09:46 GMT, blmblm@myrealbox.com
> <blmblm.myrealbox@gmail.com> wrote:
> 
> >In article <0uk317l9064bd4uaa8m8tckpvks41d7jti@4ax.com>,
> >Gene Wirchenko  <genew@ocis.net> wrote:
> >> On 2 Jul 2011 18:33:52 GMT, blmblm@myrealbox.com
> >> <blmblm.myrealbox@gmail.com> wrote:
> >> 
> >> >In article <e9ps07h56utkftkp8fcarm7uhkk5t999le@4ax.com>,
> >> >Gene Wirchenko  <genew@ocis.net> wrote:
> >> 
> >> [snip]
> >> 
> >> >>      Oh, I asked about that.  One apparently can not pass a function
> >> >> pointer parameter as in C.  The ways that were posted involved lookup
> >> >> every time AFIACS and I judged that it might swamp what I was
> >> >> measuring (checking if a character were in a set).  So, to my chagrin,
> >> >> I had to go with cut-and-paste.
> >> >
> >> >Without experimenting to find out, of course ....  
> >> 
> >>      You are putting the cart before the horse.
> >> 
> >>      THE WHOLE POINT of this exercise was experimentation to test the
> >> speed of the lookup.  Until I got the code I was asking about running,
> >> of course, I would not know.
> 
> >Maybe I misunderstood what you meant by "lookup" above --
> >I understood you to be referring to whatever has to be done
> >to find the method to be called, as opposed to looking up
> >individual characters in a list/set.  As far as I can tell,
> 
>      It was the latter.

Well, why didn't you *say* so ....  <shrug>, sort of a :-)

> >your benchmark concerns different approaches to the latter,
> >but assumes that looking up the method (i.e., using the Java
> >substitute for function pointers) will somehow skew the results
> >to the point where it shouldn't/can't be used.  (You may actually
> >be right about that, much as it pains me to say so, because all
> >that duplicate code is, in my opinion and possibly yours as well,
> >both aesthetically displeasing and a source of potential trouble.)
> 
>      Well, I only need one.  That code will get tossed shortly.

Yes.  But you did ask ....

[snip]

> >>      My phrase "not so much help" does not refer to this newsgroup.
> >> You can find texts and Websites on starting with Java.  There is also
> >> advanced material.  In the middle is a sour spot.  I am at the low end
> >> of that sour spot.
> >
> >Ah.  Interesting.  I don't seem to have a clear memory of how I got
> >from the beginning level to wherever I am now (intermediate?).  I do
> >remember, though, learning quite a bit from following semi-random
> >discussions in this newsgroup.  But that was, hm, a decade or so ago,
> >and it's not clear it would still work.  <shrug>
> 
>      In my experience, it is a common pattern.  After the beginner
> level, there are few tutorials and yet, one does not know enough to
> easily blow away the difficulties.

Maybe you could start a new thread asking for suggestions on what
to read -- I don't have any myself, but someone probably does.

-- 
B. L. Massingill
ObDisclaimer:  I don't speak for my employers; they return the favor.

[toc] | [prev] | [next] | [standalone]


#5829

Fromlewbloch <lewbloch@gmail.com>
Date2011-07-03 00:08 -0700
Message-ID<7c5d329e-6db5-4b52-8501-b9ae9c3a8738@k23g2000pri.googlegroups.com>
In reply to#5790
Gene Wirchenko wrote:
> blm...@myrealbox.com wrote
>> up a string piece by piece.  You *could* write something like
>>
>> String a = "first";
>> a += " second";
>> a += " etc";
>>
>> and my *guess* is that this is not horribly inefficient if the
>> number of concatenation operations is small.  (The conventional
>

>      IOW, who cares if it is only a bit of inefficiency?  Agreed.
>

>> wisdom, as I understand it, is that the Java runtime is pretty
>> good at managing short-lived objects, so creating new objects is
>> not invariably something to avoid, though as with anything else
>> one shouldn't get carried away, maybe.  Again the experts may
>> disagree.)
>>
>> But if there are a lot of concatenation operations it's said to be
>> more efficient to use a StringBuilder, e.g.:
>>
>> StringBuilder sb = new StringBuilder();
>> sb.append("first");
>> sb.append(" second");
>> sb.append(" etc");
>> String a = sb.toString();
>

>      It is.  My test code appends one character at a time. Switching
> from String to StringBuilder cut the execution time by about 40%.
>

>> The above is what I mostly use StringBuilder for; there are
>> undoubtedly other things one can do with it as well, some of
>> which may be useful to you (I haven't followed carefully all the
>> threads you've started).
>>

Lines like:

   String thing = getResult() + " found by " + foundSource() +".";

get optimized under the hood, so use of something like 'StringBuilder'
on such one-liners is useless.  The usefulness kicks in with the sort
of idiom blmblm described - multi-line expressions in loops where the
compiler builds lots of 'String' instances and can't figure out to use
'StringBuilder' by itself.

The efficiency doesn't come from the re-use of the 'StringBuilder'
object from iteration to iteration.  The create/destroy mechanism for
short-lived objects favors creating the temporary object inside the
loop, not outside.  The efficiency comes from not having to create so
many superfluous 'String' objects.

--
Lew

[toc] | [prev] | [next] | [standalone]


#5831

FromRobert Klemme <shortcutter@googlemail.com>
Date2011-07-03 12:35 +0200
Message-ID<97auvhFt73U1@mid.individual.net>
In reply to#5829
On 03.07.2011 09:08, lewbloch wrote:

> The efficiency doesn't come from the re-use of the 'StringBuilder'
> object from iteration to iteration.  The create/destroy mechanism for
> short-lived objects favors creating the temporary object inside the
> loop, not outside.  The efficiency comes from not having to create so
> many superfluous 'String' objects.

Lew, I find that explanation a bit strange: only reuse of StringBuilder 
makes it possible to not have to create all those superfluous String 
instances.  You make it sound as if reuse and not having to create 
superfluous String objects are somehow antithetic or independent.  If I 
cannot use a StringBuilder and I want to construct a String from parts I 
have to create superfluous String instances - so both facts are really 
related.

Kind regards

	robert

-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/

[toc] | [prev] | [next] | [standalone]


#5846

Fromlewbloch <lewbloch@gmail.com>
Date2011-07-04 04:07 -0700
Message-ID<e0fdef13-e965-492b-a702-2ff1666b80fd@j14g2000prn.googlegroups.com>
In reply to#5831
On Jul 3, 3:35 am, Robert Klemme <shortcut...@googlemail.com> wrote:
> On 03.07.2011 09:08, lewbloch wrote:
>
> > The efficiency doesn't come from the re-use of the 'StringBuilder'
> > object from iteration to iteration.  The create/destroy mechanism for
> > short-lived objects favors creating the temporary object inside the
> > loop, not outside.  The efficiency comes from not having to create so
> > many superfluous 'String' objects.
>
> Lew, I find that explanation a bit strange: only reuse of StringBuilder
> makes it possible to not have to create all those superfluous String
> instances.  You make it sound as if reuse and not having to create
> superfluous String objects are somehow antithetic or independent.  If I
> cannot use a StringBuilder and I want to construct a String from parts I
> have to create superfluous String instances - so both facts are really
> related.
>

They are independent, and I deny that I made them sound antithetic.
That's on your inference, not my implication.

The reuse of the 'StringBuilder' is not needed in some loops,
depending on whether the building occurs inside the loop entirely or
not.  That's independent of the notion that 'StringBuilder' saves on
intermediate 'String' objects.  You can tell I didn't imply that the
two are antithetical because I explicitly said to put the
'StringBuilder' inside the loop if that's what the logic requires.  If
you're paying attention you can tell, at least.

Consider:

 while ( someCondition )
 {
   StringBuilder sb = new StringBuilder();
   sb.append( getInitialStuff() );
   Result result = doSomething();
   sb.append( ". Result: " ).append( result.toString() );
   Sumpn moreShite = doSomethingWith( result );
   sb.append( ". Moreover: " ).append( moreShite.toString() );
   output( sb );
 }

Nothing in the logic of this example requires 'sb' to have scope
outside the loop, so it's foolish to put it outside the loop.  This is
independent of, and entirely compatible with, the benefits of using
'StringBuilder' to avoid a lot of intermediate 'String' objects.

--
Lew

[toc] | [prev] | [next] | [standalone]


#5784

FromPatricia Shanahan <pats@acm.org>
Date2011-06-29 14:38 -0700
Message-ID<naCdnYMg67rYBpbTnZ2dnUVZ_tqdnZ2d@earthlink.com>
In reply to#5757
On 6/28/2011 5:54 PM, Gene Wirchenko wrote:
...
>       Am I missing something about StringBuilder, or is it really this
> difficult to play with?  It would make a lot more sense to me if
> StringBuilder worked more like String does.
...

The main thing you seem to be missing about StringBuilder is that it is
not a string, it is a tool for building strings.

Here is some sample code demonstrating comparing a String to the current
contents of a StringBuilder, and replacing the entire contents with a
different String.

public class StringBuilderExample {
   public static void main(String[] args) {
     StringBuilder sb = new StringBuilder();
     sb.append("aaa");
     System.out.println(sb);
     System.out.println("aaa".equals(sb.toString()));
     sb.replace(0, Integer.MAX_VALUE, "bbbbbbb");
     System.out.println(sb);
   }
}


Patricia

[toc] | [prev] | [next] | [standalone]


#5785

FromGene Wirchenko <genew@ocis.net>
Date2011-06-29 15:00 -0700
Message-ID<9v7n071ns1n0plisods3m2pi6q68rtket5@4ax.com>
In reply to#5784
On Wed, 29 Jun 2011 14:38:04 -0700, Patricia Shanahan <pats@acm.org>
wrote:

>On 6/28/2011 5:54 PM, Gene Wirchenko wrote:
>...
>>       Am I missing something about StringBuilder, or is it really this
>> difficult to play with?  It would make a lot more sense to me if
>> StringBuilder worked more like String does.
>...
>
>The main thing you seem to be missing about StringBuilder is that it is
>not a string, it is a tool for building strings.

     Well, once I have built a string, I want to use it.

>Here is some sample code demonstrating comparing a String to the current
>contents of a StringBuilder, and replacing the entire contents with a
>different String.
>
>public class StringBuilderExample {
>   public static void main(String[] args) {
>     StringBuilder sb = new StringBuilder();
>     sb.append("aaa");
>     System.out.println(sb);
>     System.out.println("aaa".equals(sb.toString()));
>     sb.replace(0, Integer.MAX_VALUE, "bbbbbbb");
>     System.out.println(sb);
>   }
>}

     I find the .replace() line rather ornamental.  I have even more
complex parameters so I came up with my .Set() method.  I am surprised
that there is no such functionality in StringBuilder.

     I understand your example.  Either I have learned, you write good
examples, or both.

Sincerely,

Gene Wirchenko

[toc] | [prev] | [next] | [standalone]


#5787

FromPatricia Shanahan <pats@acm.org>
Date2011-06-29 15:52 -0700
Message-ID<NoSdnb6qXI8iMZbTnZ2dnUVZ_vadnZ2d@earthlink.com>
In reply to#5785
On 6/29/2011 3:00 PM, Gene Wirchenko wrote:
...
>       I find the .replace() line rather ornamental.  I have even more
> complex parameters so I came up with my .Set() method.  I am surprised
> that there is no such functionality in StringBuilder.
...

Whole line replacement is relatively rare in normal use.

The commonest usage pattern is to create a new StringBuilder
specifically for some complex string build operation. It is modified in
various ways, especially append, until the build is complete. At that
point the toString result is used.

It is relatively rare to decide, part way through a build, to throw away
the work so far and begin again with entirely different contents.

Patricia

[toc] | [prev] | [next] | [standalone]


#5791

FromGene Wirchenko <genew@ocis.net>
Date2011-06-29 18:58 -0700
Message-ID<90mn07h4ul4g3ppijpku1uc3iocc4a7pl0@4ax.com>
In reply to#5787
On Wed, 29 Jun 2011 15:52:46 -0700, Patricia Shanahan <pats@acm.org>
wrote:

[snip]

>It is relatively rare to decide, part way through a build, to throw away
>the work so far and begin again with entirely different contents.

     I am going to be doing it in a loop.  why create a new object
each iteration?

Sincerely,

Gene Wirchenko

[toc] | [prev] | [next] | [standalone]


#5793

FromPatricia Shanahan <pats@acm.org>
Date2011-06-29 19:26 -0700
Message-ID<cMmdnafXLZJuQ5bTnZ2dnUVZ_sadnZ2d@earthlink.com>
In reply to#5791
On 6/29/2011 6:58 PM, Gene Wirchenko wrote:
> On Wed, 29 Jun 2011 15:52:46 -0700, Patricia Shanahan<pats@acm.org>
> wrote:
>
> [snip]
>
>> It is relatively rare to decide, part way through a build, to throw away
>> the work so far and begin again with entirely different contents.
>
>       I am going to be doing it in a loop.  why create a new object
> each iteration?

If each iteration is doing a new string build, I'd create a new
StringBuilder for it.

Patricia

[toc] | [prev] | [next] | [standalone]


#5830

Fromlewbloch <lewbloch@gmail.com>
Date2011-07-03 00:11 -0700
Message-ID<766c1cb2-1fa1-426b-bec8-8069130cc26d@b39g2000prd.googlegroups.com>
In reply to#5791
On Jun 29, 6:58 pm, Gene Wirchenko <ge...@ocis.net> wrote:
> On Wed, 29 Jun 2011 15:52:46 -0700, Patricia Shanahan <p...@acm.org>
> wrote:
>
> [snip]
>
> >It is relatively rare to decide, part way through a build, to throw away
> >the work so far and begin again with entirely different contents.
>
>      I am going to be doing it in a loop.  why create a new object
> each iteration?
>

To avoid promotion of the object to the tenured generation, which
makes GC stuff far less efficient.  Quite often it's better to create
the temporary object inside the loop.

You should do what makes sense for the logic of the algorithm and not
try to second-guess and micromanage optimization issues.  You totally
have your head in the wrong place here.  If the scope of the object,
say the 'StringBuilder', is inside the loop, declare it inside the
loop.  Only declare it outside the loop if it's needed outside the
loop.  Don't try to be a human HotSpot engine, and stop trying to
defeat the GC optimizations.

--
Lew

[toc] | [prev] | [next] | [standalone]


#5789

FromRoedy Green <see_website@mindprod.com.invalid>
Date2011-06-29 18:32 -0700
Message-ID<6akn07lreudbcsbcp6fhk1suc3s6jp7e8k@4ax.com>
In reply to#5757
On Tue, 28 Jun 2011 17:54:38 -0700, Gene Wirchenko <genew@ocis.net>
wrote, quoted or indirectly quoted someone who said :

>
>     How does one assign a String value to a StringBuilder variable?

see http://mindprod.com/jgloss/stringbuilder.html

There is a ton of source code on the net.  Googling it looking for
various classes and methods can help you find how other programmers
use them which can help you make sense of the JavaDoc.

I use FastCat now for 95% of my string building work. It is aims to
use memory precisely to reduce the amount of GC. I only use
StringBuilder for character-by-character building.

see http://mindprod.com/products1.html#FASTCAT

-- 
Roedy Green Canadian Mind Products
http://mindprod.com
One of the curses of the computer age is manufacturers now design 
home appliances to die on the very day the warranty expires.
It is deliberate waste in the service of mindless profit.

[toc] | [prev] | [standalone]


Page 5 of 5 — ← Prev page 1 2 3 4 [5]

Back to top | Article view | comp.lang.java.programmer


csiph-web