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 20 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 4 of 5 — ← Prev page 1 2 3 [4] 5  Next page →


#5992

Fromblmblm@myrealbox.com <blmblm.myrealbox@gmail.com>
Date2011-07-08 17:45 +0000
Message-ID<97ou2gFdmmU2@mid.individual.net>
In reply to#5929
In article <ePSdnTu80Igva4nTnZ2dnUVZ_uWdnZ2d@earthlink.com>,
Patricia Shanahan  <pats@acm.org> wrote:
> 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.

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

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


#5888

Fromsupercalifragilisticexpialadiamaticonormalizeringelimatisticantations <supercalifragilisticexpialadiamaticonormalizeringelimatisticantations@averylongandannoyingdomainname.com>
Date2011-07-06 05:48 -0400
Message-ID<iv1b1j$pn3$2@speranza.aioe.org>
In reply to#5874
On 05/07/2011 5:16 PM, blmblm@myrealbox.com wrote:
> In article<jsu6171vmasu6jfvsbroa052n8u7ukarr3@4ax.com>,
> Gene Wirchenko<genew@ocis.net>  wrote:
>>    1) I can output the set in order without having to do anything else.
>> My real program has a lot of debugging info dumping.  (Read as "checks
>> that I have not done something wrong".)
>
> Ah.  Well, yes, then you probably do need a SortedSet, though
> considering that you initially build the set from a string that's in
> order, maybe you could use that (the string) instead.

Or a LinkedHashFoo of some stripe.

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


#5911

Fromblmblm@myrealbox.com <blmblm.myrealbox@gmail.com>
Date2011-07-06 16:59 +0000
Message-ID<97jikdFr6pU3@mid.individual.net>
In reply to#5888
In article <iv1b1j$pn3$2@speranza.aioe.org>,
supercalifragilisticexpialadiamaticonormalizeringelimatisticantations  <supercalifragilisticexpialadiamaticonormalizeringelimatisticantations@averylongandannoyingdomainname.com> wrote:
> On 05/07/2011 5:16 PM, blmblm@myrealbox.com wrote:
> > In article<jsu6171vmasu6jfvsbroa052n8u7ukarr3@4ax.com>,
> > Gene Wirchenko<genew@ocis.net>  wrote:
> >>    1) I can output the set in order without having to do anything else.
> >> My real program has a lot of debugging info dumping.  (Read as "checks
> >> that I have not done something wrong".)
> >
> > Ah.  Well, yes, then you probably do need a SortedSet, though
> > considering that you initially build the set from a string that's in
> > order, maybe you could use that (the string) instead.
> 
> Or a LinkedHashFoo of some stripe.

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
could put it in order before initializing the set, then yes, it seems
like a LinkedHashSet would do what he wants.

I added it to my benchmark suite, reran timing experiments, and found
LinkedHashSet to give performance very similar to that of HashSet.

A day in which I learned something new -- not bad.  Thanks!

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

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


#5916

FromGene Wirchenko <genew@ocis.net>
Date2011-07-06 10:56 -0700
Message-ID<ub8917p07lb29llk6g2o3rgbviul359p9r@4ax.com>
In reply to#5911
On 6 Jul 2011 16:59:57 GMT, blmblm@myrealbox.com
<blmblm.myrealbox@gmail.com> wrote:

[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.

>like a LinkedHashSet would do what he wants.

[snip]

Sincerely,

Gene Wirchenko

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


#5991

Fromblmblm@myrealbox.com <blmblm.myrealbox@gmail.com>
Date2011-07-08 17:44 +0000
Message-ID<97otvfFdmmU1@mid.individual.net>
In reply to#5916
In article <ub8917p07lb29llk6g2o3rgbviul359p9r@4ax.com>,
Gene Wirchenko  <genew@ocis.net> wrote:
> On 6 Jul 2011 16:59:57 GMT, blmblm@myrealbox.com
> <blmblm.myrealbox@gmail.com> wrote:
> 
> [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. L. Massingill
ObDisclaimer:  I don't speak for my employers; they return the favor.

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


#5993

FromGene Wirchenko <genew@ocis.net>
Date2011-07-08 11:51 -0700
Message-ID<m4ke175pm36k99ci4i2sbv3f2ukgpeaaq3@4ax.com>
In reply to#5991
On 8 Jul 2011 17:44:16 GMT, blmblm@myrealbox.com
<blmblm.myrealbox@gmail.com> wrote:

>In article <ub8917p07lb29llk6g2o3rgbviul359p9r@4ax.com>,
>Gene Wirchenko  <genew@ocis.net> wrote:
>> On 6 Jul 2011 16:59:57 GMT, blmblm@myrealbox.com
>> <blmblm.myrealbox@gmail.com> wrote:
>> 
>> [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

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


#6056

Fromblmblm@myrealbox.com <blmblm.myrealbox@gmail.com>
Date2011-07-10 19:08 +0000
Message-ID<97ublnFag8U4@mid.individual.net>
In reply to#5993
In article <m4ke175pm36k99ci4i2sbv3f2ukgpeaaq3@4ax.com>,
Gene Wirchenko  <genew@ocis.net> wrote:
> On 8 Jul 2011 17:44:16 GMT, blmblm@myrealbox.com
> <blmblm.myrealbox@gmail.com> wrote:
> 
> >In article <ub8917p07lb29llk6g2o3rgbviul359p9r@4ax.com>,
> >Gene Wirchenko  <genew@ocis.net> wrote:
> >> On 6 Jul 2011 16:59:57 GMT, blmblm@myrealbox.com
> >> <blmblm.myrealbox@gmail.com> wrote:
> >> 
> >> [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", ....  :-)?

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

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


#6070

FromGene Wirchenko <genew@ocis.net>
Date2011-07-11 07:54 -0700
Message-ID<mf3m17t47umd9msjgbh651b7k82v09325q@4ax.com>
In reply to#6056
On 10 Jul 2011 19:08:40 GMT, blmblm@myrealbox.com
<blmblm.myrealbox@gmail.com> wrote:

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

[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

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


#6089

Fromblmblm@myrealbox.com <blmblm.myrealbox@gmail.com>
Date2011-07-11 22:37 +0000
Message-ID<981ca7FlgtU4@mid.individual.net>
In reply to#6070
In article <mf3m17t47umd9msjgbh651b7k82v09325q@4ax.com>,
Gene Wirchenko  <genew@ocis.net> wrote:
> On 10 Jul 2011 19:08:40 GMT, blmblm@myrealbox.com
> <blmblm.myrealbox@gmail.com> wrote:
> 
> >In article <m4ke175pm36k99ci4i2sbv3f2ukgpeaaq3@4ax.com>,
> >Gene Wirchenko  <genew@ocis.net> wrote:
> 
> [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.

I know I don't always express myself with 100% clarity, but really,
I must be doing worse than usual here ....

I did not attempt to measure speed of initialization.  That would
indeed be silly, and I don't understand why you would think ....
Well, be that as it may:

What I did was add to your benchmark code a test for LinkedHashSet,
identical to the one for TreeSet except for the type of set.  When 
I ran the resulting code, the output indicated that LinkedHashSet
was sufficiently faster than TreeSet for me to think you might
be interested.  "Faster" here means "faster by your criterion as
I understand it".  If you've made a decision and want to stop
dithering about whether you might have missed something someone
thinks might suit you better, okay, but ....  Well, whatever.

By the way, I'm still mildly curious about why you decided, without
testing, that it would not be a good idea to follow the suggestions
you were given about avoiding all that tedious cut-and-paste.  In

Message-ID: <e9ps07h56utkftkp8fcarm7uhkk5t999le@4ax.com>

you wrote

>     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.

It's interesting to me that you were able to reach this conclusion
(that using Java's alternative to function pointers *does* affect
benchmarking results) without doing any experiments -- I think
you're probably right, but I did some experiments before coming to
the same conclusion.  "Whatever" again.

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

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


#6091

FromGene Wirchenko <genew@ocis.net>
Date2011-07-11 15:52 -0700
Message-ID<kbvm1717l9gumhhlvcg5ol4sgv2kmduh09@4ax.com>
In reply to#6089
On 11 Jul 2011 22:37:59 GMT, blmblm@myrealbox.com
<blmblm.myrealbox@gmail.com> wrote:

[snip]

>By the way, I'm still mildly curious about why you decided, without
>testing, that it would not be a good idea to follow the suggestions
>you were given about avoiding all that tedious cut-and-paste.  In

     Because it was a test program.  I was not going to keep the code.
I have not thrown it out yet, but I could.  Its job is done.  The
"real" program only has one type of search, namely the one that I
found to be fastest (using TestSet).

[snip]

>It's interesting to me that you were able to reach this conclusion
>(that using Java's alternative to function pointers *does* affect
>benchmarking results) without doing any experiments -- I think
>you're probably right, but I did some experiments before coming to
>the same conclusion.  "Whatever" again.

     I had no easy way to test, was fairly confident of the result of
any such test, and it almost certainly did not matter.  For the
search, none of those conditions were so.

     At some point, one has to do something in order to end up having
done something.

Sincerely,

Gene Wirchenko

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


#5892

Fromsupercalifragilisticexpialadiamaticonormalizeringelimatisticantations <supercalifragilisticexpialadiamaticonormalizeringelimatisticantations@averylongandannoyingdomainname.com>
Date2011-07-06 08:25 -0400
Message-ID<iv2b1j$pf3$2@speranza.aioe.org>
In reply to#5874
On 05/07/2011 5:16 PM, blmblm@myrealbox.com wrote:
> In article<jsu6171vmasu6jfvsbroa052n8u7ukarr3@4ax.com>,
> Gene Wirchenko<genew@ocis.net>  wrote:
>>    1) I can output the set in order without having to do anything else.
>> My real program has a lot of debugging info dumping.  (Read as "checks
>> that I have not done something wrong".)
>
> Ah.  Well, yes, then you probably do need a SortedSet, though
> considering that you initially build the set from a string that's in
> order, maybe you could use that (the string) instead.

Or a <thoolen@tholenbot.thorium> madness of some stripe.

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


#5927

Fromsupercalifragilisticexpialadiamaticonormalizeringelimatisticantations <supercalifragilisticexpialadiamaticonormalizeringelimatisticantations@averylongandannoyingdomainname.com>
Date2011-07-06 19:41 -0400
Message-ID<iv2rr6$nqu$1@speranza.aioe.org>
In reply to#5892
On 06/07/2011 8:25 AM, 
supercalifragilisticexpialadiamaticonormalizeringelimatisticantations wrote:
>
> On 05/07/2011 5:16 PM, blmblm@myrealbox.com wrote:
>> In article<jsu6171vmasu6jfvsbroa052n8u7ukarr3@4ax.com>,
>> Gene Wirchenko<genew@ocis.net> wrote:
>>> 1) I can output the set in order without having to do anything else.
>>> My real program has a lot of debugging info dumping. (Read as "checks
>>> that I have not done something wrong".)
>>
>> Ah. Well, yes, then you probably do need a SortedSet, though
>> considering that you initially build the set from a string that's in
>> order, maybe you could use that (the string) instead.
>
> Or a <thoolen@tholenbot.thorium> madness of some stripe.

WTF???

I didn't post this.

Who's forging my from and why?

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


#5934

Fromsupercalifragilisticexpialadiamaticonormalizeringelimatisticantations <supercalifragilisticexpialadiamaticonormalizeringelimatisticantations@averylongandannoyingdomainname.com>
Date2011-07-06 19:58 -0400
Message-ID<iv2rd6$vqb$1@speranza.aioe.org>
In reply to#5927
On 06/07/2011 7:41 PM, 
supercalifragilisticexpialadiamaticonormalizeringelimatisticantations wrote:
>On 06/07/2011 8:25 AM, 
>supercalifragilisticexpialadiamaticonormalizeringelimatisticantations wrote:
>>
>> On 05/07/2011 5:16 PM, blmblm@myrealbox.com wrote:
>>> In article<jsu6171vmasu6jfvsbroa052n8u7ukarr3@4ax.com>,
>>> Gene Wirchenko<genew@ocis.net> wrote:
>>>> 1) I can output the set in order without having to do anything else.
>>>> My real program has a lot of debugging info dumping. (Read as "checks
>>>> that I have not done something wrong".)
>>>
>>> Ah. Well, yes, then you probably do need a SortedSet, though
>>> considering that you initially build the set from a string that's in
>>> order, maybe you could use that (the string) instead.
>>
>> Or a <thoolen@tholenbot.thorium> madness of some stripe.
>
>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: abuse@aioe.org

make it simple. small short words, there is a clue.
Like "I am a fuckhead who likes to fuck 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]

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


#5939

Fromsupercalifragilisticexpialadiamaticonormalizeringelimatisticantations <supercalifragilisticexpialadiamaticonormalizeringelimatisticantations@averylongandannoyingdomainname.com>
Date2011-07-06 21:57 -0400
Message-ID<iv33qt$55d$3@speranza.aioe.org>
In reply to#5934
On 06/07/2011 7:58 PM, someone pretending to be me wrote:
> On 06/07/2011 7:41 PM,
> supercalifragilisticexpialadiamaticonormalizeringelimatisticantations
> wrote:
>> WTF???
>>
>> I didn't post this.
>>
>> Who's forging my from and why?
>
> 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 fuck off 
the 'net, jerkoff?

> Like "I am a fuckhead who likes to fuck 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.

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


#5942

Fromsupercalifragilisticexpialadiamaticonormalizeringelimatisticantations <supercalifragilisticexpialadiamaticonormalizeringelimatisticantations@averylongandannoyingdomainname.com>
Date2011-07-06 22:17 -0400
Message-ID<it33qt$57d$3@speranza.aioe.org>
In reply to#5939
On 06/07/2011 8:58 PM, Paul Derbyshire - Pembroke[ontario.ca] wrote:

>> Like "I am a fuckhead who likes to fuck 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

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


#5948

Fromsupercalifragilisticexpialadiamaticonormalizeringelimatisticantations <supercalifragilisticexpialadiamaticonormalizeringelimatisticantations@averylongandannoyingdomainname.com>
Date2011-07-06 22:44 -0400
Message-ID<iv36hj$a33$3@speranza.aioe.org>
In reply to#5942
On 06/07/2011 10:17 PM, 
supercalifragilisticexpialadiamaticonormalizeringelimatisticantations wrote:
>
> On 06/07/2011 8:58 PM, Paul Derbyshire - Pembroke[ontario.ca] wrote:
>
>>> Like "I am a fuckhead who likes to fuck 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.

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


#5950

FromSteve Erwin <trollHunter@Usenet.4.usenetizens.org.invalid>
Date2011-07-07 12:51 +1000
Message-ID<4e151f9e$0$3713$c3e8da3$12bcf670@news.astraweb.com>
In reply to#5948
supercalifxxxxPaul Derbyshire - Pembroke Ontario CA 
>On 06/07/2011 10:17 PM, 
>supercalifragilisticexpialadiamaticonormalizeringelimatisticantations wrote:
>>
>> On 06/07/2011 8:58 PM, Paul Derbyshire - Pembroke[ontario.ca] wrote:
>>
>>>> Like "I am a fuckhead who likes to fuck 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.

-- 

Steve - peeling open the mad kanuck's scrotum

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


#5953

Fromsupercalifragilisticexpialadiamaticonormalizeringelimatisticantations <supercalifragilisticexpialadiamaticonormalizeringelimatisticantations@averylongandannoyingdomainname.com>
Date2011-07-06 23:02 -0400
Message-ID<iv37jt$bo1$3@speranza.aioe.org>
In reply to#5950
On 06/07/2011 10:51 PM, Steve Erwin wrote:
> supercalifxxxxPaul Derbyshire - Pembroke Ontario CA

What the fuck 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.

> 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?

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


#6179

FromJohn Doe <jdoe@usenetlove.invalid>
Date2011-07-14 06:32 +0000
Message-ID<4e1e8d6c$0$21275$c3e8da3$a9097924@news.astraweb.com>
In reply to#5953
supercalifragilisticexpialadiamaticonormalizeringelimatisticantatio
ns
<supercalifragilisticexpialadiamaticonormalizeringelimatisticantati
ons averylongandannoyingdomainname.com> 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. 

> 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? 

> 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.

> 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. 
-- 
















Probably a regular
nym-shifting
changed the follow-up groups
> Path: news.astraweb.com!border6.newsrouter.astraweb.com!feed.news.qwest.net!mpls-nntp-03.inet.qwest.net!195.114.241.41.MISMATCH!feeder.news-service.com!feeder.news-service.com!94.75.214.39.MISMATCH!aioe.org!.POSTED!not-for-mail
> From: supercalifragilisticexpialadiamaticonormalizeringelimatisticantations <supercalifragilisticexpialadiamaticonormalizeringelimatisticantations averylongandannoyingdomainname.com>
> Newsgroups: comp.lang.java.programmer,comp.lang.lisp
> Subject: Re: StringBuilder Difficulties
> Followup-To: alt.dev.null
> Date: Wed, 06 Jul 2011 23:02:19 -0400
> Organization: supercalifragilisticexpialadiamaticonormalizeringelimatisticantations
> Lines: 22
> Message-ID: <iv37jt$bo1$3 speranza.aioe.org>
> References: <c4tk07dv1pq7u8k32qd6b7o1brc2rj8r30 4ax.com> <ual3175uj4e5jb7u44q8jn7soo7k532heq 4ax.com> <97h616FhaeU3 mid.individual.net> <jsu6171vmasu6jfvsbroa052n8u7ukarr3 4ax.com> <97hd9sFa1jU2 mid.individual.net> <iv2b1j$pf3$2 speranza.aioe.org> <iv2rr6$nqu$1 speranza.aioe.org> <iv2rd6$vqb$1 speranza.aioe.org> <iv33qt$55d$3 speranza.aioe.org> <it33qt$57d$3 speranza.aioe.org> <iv36hj$a33$3 speranza.aioe.org> <4e151f9e$0$3713$c3e8da3$12bcf670 news.astraweb.com>
> NNTP-Posting-Host: 9zMfMLj7Kt4oubZ/fw1Ukg.user.speranza.aioe.org
> Mime-Version: 1.0
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> Content-Transfer-Encoding: 7bit
> X-Complaints-To: abuse aioe.org
> User-Agent: WinVN 0.99.12z (x86 32bit)
> X-Notice: Filtered by postfilter v. 0.8.2
> 

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


#6181

Fromsupercalifragilisticexpialadiamaticonormalizeringelimatisticantations <supercalifragilisticexpialadiamaticonormalizeringelimatisticantations@averylongandannoyingdomainname.com>
Date2011-07-14 02:57 -0400
Message-ID<ivm40o$994$1@speranza.aioe.org>
In reply to#6179
On 14/07/2011 2:32 AM, John Doe wrote:
> supercalifragilisticexpialadiamaticonormalizeringelimatisticantatio
>> What the fuck is that?
>
> Looks like an effort to shorten your obnoxious ID, asshole.

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

>> Threats?
>
> Are you new to UseNet, asshole?

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

>> 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.

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

>> 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.

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

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


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

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


csiph-web