Re: Any Checkstyle users?



Roedy Green wrote:

[me:]
> > Except that that isn't true. The name should be something like
> > private static final int
> > INITIAL_ESTIMATE_OF_PROBABLE_MAX_GUESTS = 50; which is unwieldy in
> > the extreme, but calling it MAX_GUESTS is actively wrong and so
> > must be avoided.
>
> How let us say the capacity factor is .75 and you set the size at
> 100. How big is the array inside 100 or 133? Not knowing that could
> give you poor performance with the beasts.

Good question! I had assumed that the capacity was the number of
actual entries expected -- regardless of load factor. But it seems
that the code intereprets it as the size of the array to allocate, with
the load factor determining how many of the occupied slots are allowed
before it grows itself.

In point of fact, the implementation rounds the capacity up to a power
of two.

Anyway, none of that's clear from the documentation -- which is
unforgivable. I don't care for the choice they've made for the
interpretation of "capacity" (in fact I think it's stupid), but leaving
the matter open to guesswork is <pauses, and chooses a less loaded
word> regrettable.

That being the case, my recommended identifier name is also wrong. I
leave it to the reader to find a managable identifier that expresses
the concept
Initial estimate of the probable maximum number of
expected guests, adjusted to take account of the (undocumented)
relationship between the "load factor" and "capacity" of a
java.util.HashMap.

Personally, I find that just
50
is as clear as anything ;-)

-- chris
.



Relevant Pages

  • Re: Battery level tester.
    ... > You can't simply relate voltage to usable capacity remaining, ... When the load is dynamic, ... They are voltage devices and only run two leads to the battery. ... These are probably the gold standard gauges used for EVs. ...
    (sci.electronics.design)
  • Re: How many Amps to specify for a dimming system.
    ... > Manager needs to do the math for each design to see that the total load ... > load every dimmer to capacity and run them flat out. ... with potentially disastrous consequences. ...
    (rec.arts.theatre.stagecraft)
  • Re: determining flooded deep cycle SOC?
    ... for the terminal voltage to recover to these o/c values before taking ... a SOC vs on load table? ... IR drop is highly dependent on particular battery design. ... accurate capacity gauges (such as impedance track ...
    (sci.chem.electrochem.battery)
  • Re: Load exceeding supply current
    ... supplies (average load current works out to be 10A) and place a big cap across the load. ... Power supplies in series interfere in each other's feedback loop; given the dynamic load, ... It will recharge back to full voltage with the excess current capacity during the rest of the cycle. ... Coupling the big capacitor to the supply through a big inductor will let the cap carry more of the peak current but will smooth out the current drawn from the supply. ...
    (sci.electronics.design)
  • Re: measuring 12V 12Ah Lead-Acid battery
    ... I do know very well that the open circuit measurement ... I guess I'll just put up some load and measure how long it takes ... run it down to 10Vas you said, and calculate capacity from that. ... > Disconnect all loads and thenstart the UPS ...
    (sci.electronics.design)