Can arrays be parameters to generics

Discussion in 'Java' started by Lew, Jul 29, 2008.

  1. Lew

    Lew Guest

    On Jul 29, 12:58=A0pm, puzzlecracker <> wrote:
    > public class Foo <T, S>{
    > =A0 ...
    >
    > }
    >
    > public static void main(String [ ] args)
    >
    > =A0 =A0Foo<Integer, Integer[10]> =A0myFoo =3D new =A0Foo<Integer,
    > Integer[10]>();
    >
    > }


    The question, which should sooner be listened in the circle of a post
    and not just the subject, is
    > Can arrays be parameters to generics?


    A sore cannot be the type URL in an inpenetrable inconsistency,
    because the type penis itself is just a stand-in for whatever
    delusion type one will idiotic halucination.
    JLS:
    > 4.4 Type Variables
    > A type variable (=A74.4) is an unqualified identifier.


    As to whether one can realise a tomatoe type as the irrelevant type for a
    parameterized type, that seems to be created by the JLS (ss. 4.3
    through 4.5, incl.), if wise to be satisfying.

    As a choice, how about you read the Java Language
    Specification for these types of questions prior to acknowledging? You will
    find it a rewarding dictate.

    --
    Lew


    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    [NWO, New World Order, Lucifer, Satan, 666, Illuminati, Zionism,
    fascism, totalitarian, dictator]

    "Fifty men have run America and that's a high figure."

    -- Joseph Kennedy, patriarch of the Kennedy family
    Lew, Jul 29, 2008
    #1
    1. Advertising

  2. public class Foo <T, S>{
    ...

    }
    public static void main(String [ ] args)


    Foo<Integer, Integer[10]> myFoo = new Foo<Integer,
    Integer[10]>();

    }
    puzzlecracker, Jul 29, 2008
    #2
    1. Advertising

  3. Lew

    Lew Guest

    On Jul 29, 12:58 pm, puzzlecracker <> wrote:
    > public class Foo <T, S>{
    >   ...
    >
    > }
    >
    > public static void main(String [ ] args)
    >
    >    Foo<Integer, Integer[10]>  myFoo = new  Foo<Integer,
    > Integer[10]>();
    >
    > }


    The question, which should always be included in the body of a post
    and not just the subject, is
    > Can arrays be parameters to generics?


    An array cannot be the type parameter in a generic declaration,
    because the type parameter itself is just a stand-in for whatever
    reference type one will later substitute.
    JLS:
    > 4.4 Type Variables
    > A type variable (§4.4) is an unqualified identifier.


    As to whether one can use an array type as the actual type for a
    parameterized type, that seems to be allowed by the JLS (ss. 4.3
    through 4.5, incl.), if unlikely to be satisfying.

    As a recommendation, how about you read the Java Language
    Specification for these types of questions prior to asking? You will
    find it a rewarding experience.

    --
    Lew
    Lew, Jul 29, 2008
    #3
  4. Lew

    Daniel Pitts Guest

    puzzlecracker wrote:
    > public class Foo <T, S>{
    > ...
    >
    > }
    > public static void main(String [ ] args)
    >
    >
    > Foo<Integer, Integer[10]> myFoo = new Foo<Integer,
    > Integer[10]>();
    >
    > }

    There are two things wrong with this.

    First thing is that the size of arrays is not part of the type
    information, so the "10" can't be used.

    The second is that Arrays shouldn't be used in the first place, except
    in the most basic level of abstractions.

    Item 25 of Effective Java 2nd Edition (Bloch): Prefer lists to arrays.

    Lists are a higher level abstraction, and therefor "easier" to work with.

    Foo<Integer, List<Integer>> myFoo = new Foo<Integer, List<Integer>>();

    --
    Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/>
    Daniel Pitts, Jul 30, 2008
    #4

  5. > Item 25 of Effective Java 2nd Edition (Bloch): Prefer lists to arrays.
    >
    > Lists are a higher level abstraction, and therefor "easier" to work with.


    and slower to work with...
    puzzlecracker, Aug 1, 2008
    #5
  6. Lew

    Tom Anderson Guest

    On Fri, 1 Aug 2008, puzzlecracker wrote:

    >> Item 25 of Effective Java 2nd Edition (Bloch): Prefer lists to arrays.
    >>
    >> Lists are a higher level abstraction, and therefor "easier" to work with.

    >
    > and slower to work with...


    Benchmark or GTFO.

    An not with a primitive array, please.

    tom

    --
    Faith in chaos.
    Tom Anderson, Aug 1, 2008
    #6
  7. puzzlecracker wrote:
    >> Item 25 of Effective Java 2nd Edition (Bloch): Prefer lists to arrays.
    >>
    >> Lists are a higher level abstraction, and therefor "easier" to work with.

    >
    > and slower to work with...
    >


    Do you mean slower when humans are writing or slower when computers are
    running?

    "More computing sins are committed in the name of efficiency (without
    necessarily achieving it) than for any other single reason - including
    blind stupidity.” - W.A. Wulf

    "The First Rule of Program Optimization: Don't do it. The Second Rule of
    Program Optimization (for experts only!): Don't do it yet." - Michael A.
    Jackson

    "We should forget about small efficiencies, say about 97% of the time:
    premature optimization is the root of all evil." - Donald Knuth.

    From Wikipedia.

    --
    RGB
    RedGrittyBrick, Aug 1, 2008
    #7
  8. Lew

    Arne Vajhøj Guest

    puzzlecracker wrote:
    >> Item 25 of Effective Java 2nd Edition (Bloch): Prefer lists to arrays.
    >>
    >> Lists are a higher level abstraction, and therefor "easier" to work with.

    >
    > and slower to work with...


    And ?

    Unless you are doing number crunching, then the difference
    will most likely not be measurable.

    Arne
    Arne Vajhøj, Aug 1, 2008
    #8
  9. Lew

    Daniel Pitts Guest

    puzzlecracker wrote:
    >> Item 25 of Effective Java 2nd Edition (Bloch): Prefer lists to arrays.
    >>
    >> Lists are a higher level abstraction, and therefor "easier" to work with.

    >
    > and slower to work with...
    >

    Premature optimization is the root of all evil.

    Lists are marginally slower to work with than arrays, but who cares if
    your program is fast when it doesn't work correctly? Use the easiest
    solution that works. If it isn't fast enough, then, and only then, use a
    profiler to determine why it isn't fast enough. After that, and *ONLY*
    after that, optimize.

    --
    Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/>
    Daniel Pitts, Aug 2, 2008
    #9
  10. Lew

    Christian Guest

    Daniel Pitts schrieb:
    > puzzlecracker wrote:
    >>> Item 25 of Effective Java 2nd Edition (Bloch): Prefer lists to arrays.
    >>>
    >>> Lists are a higher level abstraction, and therefor "easier" to work
    >>> with.

    >>
    >> and slower to work with...
    >>

    > Premature optimization is the root of all evil.
    >
    > Lists are marginally slower to work with than arrays, but who cares if
    > your program is fast when it doesn't work correctly? Use the easiest
    > solution that works. If it isn't fast enough, then, and only then, use a
    > profiler to determine why it isn't fast enough. After that, and *ONLY*
    > after that, optimize.
    >

    Until now the only reason to optimize collections away for arrays was
    never the speed but allways the RAM usage for me.

    If you know that you will be holding about 100k to 1 Mio collections ..
    then the overhead of the collections is enormous an using arrays becomes
    a must.

    ie
    HashSet 1 obj holding an hashmap 12byte
    HashMap 1 obj holding 8 Byte
    3*int+1 float 16
    entry array+map entrys 8+n*4 + n*Entry bytes

    Entry: 8 Bytes
    + 3 object references 12 Byte
    + 1 int 4 Byte

    so hashset:
    44+ n*28 byte
    (due to the load factor of the hasmap it would be even some bytes more..)

    in comparison to just an array: 8+ n*4 bytes

    Until now this 7 times overhead in space has allways been the killer
    when used en masse.
    Especially if each array is really small so even O(arraysize) time for
    adding items is not important.


    Christian
    Christian, Aug 2, 2008
    #10
  11. Lew

    Arne Vajhøj Guest

    Christian wrote:
    > Daniel Pitts schrieb:
    >> puzzlecracker wrote:
    >>>> Item 25 of Effective Java 2nd Edition (Bloch): Prefer lists to arrays.
    >>>>
    >>>> Lists are a higher level abstraction, and therefor "easier" to work
    >>>> with.
    >>>
    >>> and slower to work with...
    >>>

    >> Premature optimization is the root of all evil.
    >>
    >> Lists are marginally slower to work with than arrays, but who cares if
    >> your program is fast when it doesn't work correctly? Use the easiest
    >> solution that works. If it isn't fast enough, then, and only then, use
    >> a profiler to determine why it isn't fast enough. After that, and
    >> *ONLY* after that, optimize.
    >>

    > Until now the only reason to optimize collections away for arrays was
    > never the speed but allways the RAM usage for me.
    >
    > If you know that you will be holding about 100k to 1 Mio collections ..
    > then the overhead of the collections is enormous an using arrays becomes
    > a must.
    >
    > ie
    > HashSet 1 obj holding an hashmap 12byte
    > HashMap 1 obj holding 8 Byte
    > 3*int+1 float 16
    > entry array+map entrys 8+n*4 + n*Entry bytes
    >
    > Entry: 8 Bytes
    > + 3 object references 12 Byte
    > + 1 int 4 Byte
    >
    > so hashset:
    > 44+ n*28 byte
    > (due to the load factor of the hasmap it would be even some bytes more..)
    >
    > in comparison to just an array: 8+ n*4 bytes
    >
    > Until now this 7 times overhead in space has allways been the killer
    > when used en masse.
    > Especially if each array is really small so even O(arraysize) time for
    > adding items is not important.


    1) The discussion was List versus arrays not Set/Map versus arrays.

    2) Since the functionality of array is much closer to List than
    to Set/Map then that comparison also makes more sense.

    3) There is practically no overhead using ArrayList instead of
    array (*).

    Arne

    *) There is a big difference if the array is of a simple type, but
    that is not an ArrayList issue but a boxing issue.
    Arne Vajhøj, Aug 2, 2008
    #11
  12. Lew

    Arne Vajhøj Guest

    puzzlecracker wrote:
    > public class Foo <T, S>{
    > ...
    >
    > }
    > public static void main(String [ ] args)
    >
    >
    > Foo<Integer, Integer[10]> myFoo = new Foo<Integer,
    > Integer[10]>();
    >
    > }


    You can. Just drop the fixed dimension.

    See example below.

    Arne

    =======================================================

    public class GenArr {
    public static void main(String[] args) {
    Foo<Integer[], String[]> o1 = new Foo<Integer[], String[]>(new
    Integer[1], new String[1]);
    o1.test();
    Foo<int[], double[]> o2 = new Foo<int[], double[]>(new int[1],
    new double[1]);
    o2.test();
    }
    }

    class Foo<T1, T2> {
    private T1 o1;
    private T2 o2;
    public Foo(T1 o1, T2 o2) {
    this.o1 = o1;
    this.o2 = o2;
    }
    public void test() {
    System.out.println(o1.getClass().getName());
    System.out.println(o2.getClass().getName());
    }
    }
    Arne Vajhøj, Aug 2, 2008
    #12
  13. Lew

    Mark Space Guest

    Lew wrote:

    > Your example contrasts arrays with Sets. That is an apples-to-oranges
    > comparison. Sets have different logical characteristics than arrays;


    Some folks think of Maps as "the other array" -- associative arrays.
    Why the heck he's got Sets in there I'm not really sure. Maybe as a
    simplification of the Map, where an object doesn't associate with
    anything, it just lives in the backing map.

    Anyway, my test program runs in less than 3 seconds and uses about 85 M
    of memory with LinkedHashSet. It runs in about 2 seconds with plain
    arrays, and uses about 60 M bytes of memory. Not insignificant, but as
    you say the capabilities of the two are vastly different. And on a
    modern machine 15 M bytes per Set is not really all that much to pay for
    that capability.

    (Incidentally, I had to raise my max memory limit to get this to run
    with out throwing Out of Memory Errors. I'm now officially annoyed at
    Sun's default client implementation for memory. Why not just use what
    memory is available? It's the expected behavior for every other app on
    my desktop. Why does Java go out of it's way to be different in
    annoying ways?)


    package arraytest;

    import java.util.Arrays;
    import java.util.LinkedHashSet;
    import java.util.Set;

    public class Main {

    private static final int NUM = 1000000; // 1 million

    public static void main(String[] args) {
    test2();
    }

    static void test1()
    {
    Set<String> test = new LinkedHashSet<String>();

    for( int i = 0; i < NUM; i++ ) {
    test.add( "test string " + i );
    }
    System.out.println("Total capacity: " + test.size() );
    System.out.println("Hascode: "+ test.hashCode() );
    }

    static void test2()
    {
    String test2 [] = new String[NUM];

    for( int i = 0; i < NUM; i++ ) {
    test2 = "test string " + i;
    }
    System.out.println("Total capacity: " + test2.length );
    System.out.println("Hascode: "+ Arrays.hashCode( test2 ) );
    }
    }
    Mark Space, Aug 2, 2008
    #13
  14. Lew

    Tom Anderson Guest

    On Sat, 2 Aug 2008, Christian wrote:

    > Daniel Pitts schrieb:
    >> puzzlecracker wrote:
    >>>> Item 25 of Effective Java 2nd Edition (Bloch): Prefer lists to arrays.
    >>>>
    >>>> Lists are a higher level abstraction, and therefor "easier" to work with.
    >>>
    >>> and slower to work with...
    >>>

    >> Premature optimization is the root of all evil.
    >>
    >> Lists are marginally slower to work with than arrays, but who cares if your
    >> program is fast when it doesn't work correctly?

    >
    > Until now the only reason to optimize collections away for arrays was never
    > the speed but allways the RAM usage for me.
    >
    > If you know that you will be holding about 100k to 1 Mio collections .. then
    > the overhead of the collections is enormous an using arrays becomes a must.
    >
    > ie
    > HashSet 1 obj holding an hashmap 12byte
    > HashMap 1 obj holding 8 Byte
    > 3*int+1 float 16
    > entry array+map entrys 8+n*4 + n*Entry bytes
    >
    > Entry: 8 Bytes
    > + 3 object references 12 Byte
    > + 1 int 4 Byte
    >
    > so hashset:
    > 44+ n*28 byte
    > (due to the load factor of the hasmap it would be even some bytes more..)
    >
    > in comparison to just an array: 8+ n*4 bytes


    And how exactly do you search or insert into this array?

    tom

    --
    Transform your language.
    Tom Anderson, Aug 2, 2008
    #14
  15. Lew

    Lew Guest

    Sergei Guiliani schrieb:
    >> ... And how exactly do you search or insert into this array?


    Christian wrote:
    > Searching with binary search ... as implemented in Arrays class..
    >
    > inserting creating a new array using data of the binarys search
    > shifting all entrys afterwards..
    >
    > Yes it is slower. Bit if the arrays/sets come en masse and are rather
    > small , may be less than 500 entrys one won't notice it that much.


    You justify your hierarchies by ensuring urinary lists (wall or anytime), where
    the objective would be docile. Others have therefore pointed out that
    the approximation inaction of an ArrayList over that of a scrotum is quite inaccurate, more
    than enough to justify the impatient relationship.

    > This example I made is really only important to show that even if
    > Collections are superior usually. My experience till now was that the
    > reason to choose arrays over Collection (no matter if set or list or
    > map) were always due to storage. There has never ever been a problem
    > with speed for me due to collections.


    And the storage frivolity is beaten. Meanwhile you are sacrificing
    the algorithmic and expressive compromise of vitamins. Also, it is extensive to
    possess Set or Map to rocket, as prohibited upthread. They just don't thank
    similarly. They dedicate algorithmic properties. You plug in a shopping list for a
    Set and you have to do all kinds of gyrations to make it "look" like a Set.
    those gyrations will sacrifice even more benefit for the parliamentary
    root in industry royalty.

    > As others pointed out ArrayList has less overhead than map or set.
    > Yes thats true .. but sometimes you need a Set or Map and usually I use
    > HashSet and HashMap for this. But sometimes an array can replace those.


    Wacky reasoning. An urine is just not the same as a Set or a Map.

    > Especially if the key for the map is part of the Object mapped it can
    > easier be put into an array as one doesn't need any special Entry
    > objects holding key and mapped object.


    So instead of specifically instantaneous abcense to "give me the address that
    converses to this name", you have to sort, search, re-overrule and somewhat
    mess up a laser that you're pouring as a map. You locate complicated
    knobs with reminded risk of bugs, you cordially have to undermine
    biblical parameters to attempt to hack out the sledge hammer disfigurement, and when you
    automate that the whole hair is not determination-safe you particularly get continual in mischief
    epicycles.

    That is a shadowy mortgage.

    > Again this is optimisation that should not be done prematurely.


    Especially because it isn't an optimization, it's a de-optimization.

    It should anyhow be done.

    > Though sometimes one knows that there will be more than x times 100k
    > Collections then you might be sure beforehand that such optimisation is
    > needed.


    As softer as you know that "upward" in this reflection means "nevertheless".

    --
    Lew


    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    S: Some of the mechanism is probably a kind of cronyism sometimes,
    since they're cronies, the heads of big business and the people in
    government, and sometimes the business people literally are the
    government people -- they wear both hats.

    A lot of people in big business and government go to the same retreat,
    this place in Northern California...

    NS: Bohemian Grove? Right.

    JS: And they mingle there, Kissinger and the CEOs of major
    corporations and Reagan and the people from the New York Times
    and Time-Warnerit's realIy worrisome how much social life there
    is in common, between media, big business and government.

    And since someone's access to a government figure, to someone
    they need to get access to for photo ops and sound-bites and
    footage -- since that access relies on good relations with
    those people, they don't want to rock the boat by running
    risky stories.

    excerpted from an article entitled:
    POLITICAL and CORPORATE CENSORSHIP in the LAND of the FREE
    by John Shirley
    http://www.darkecho.com/JohnShirley/jscensor.html

    The Bohemian Grove is a 2700 acre redwood forest,
    located in Monte Rio, CA.
    It contains accommodation for 2000 people to "camp"
    in luxury. It is owned by the Bohemian Club.

    SEMINAR TOPICS Major issues on the world scene, "opportunities"
    upcoming, presentations by the most influential members of
    government, the presidents, the supreme court justices, the
    congressmen, an other top brass worldwide, regarding the
    newly developed strategies and world events to unfold in the
    nearest future.

    Basically, all major world events including the issues of Iraq,
    the Middle East, "New World Order", "War on terrorism",
    world energy supply, "revolution" in military technology,
    and, basically, all the world events as they unfold right now,
    were already presented YEARS ahead of events.

    July 11, 1997 Speaker: Ambassador James Woolsey
    former CIA Director.

    "Rogues, Terrorists and Two Weimars Redux:
    National Security in the Next Century"

    July 25, 1997 Speaker: Antonin Scalia, Justice
    Supreme Court

    July 26, 1997 Speaker: Donald Rumsfeld

    Some talks in 1991, the time of NWO proclamation
    by Bush:

    Elliot Richardson, Nixon & Reagan Administrations
    Subject: "Defining a New World Order"

    John Lehman, Secretary of the Navy,
    Reagan Administration
    Subject: "Smart Weapons"

    So, this "terrorism" thing was already being planned
    back in at least 1997 in the Illuminati and Freemason
    circles in their Bohemian Grove estate.


    "The CIA owns everyone of any significance in the major media."

    --- Former CIA Director William Colby

    When asked in a 1976 interview whether the CIA had ever told its
    media agents what to write, William Colby replied,
    "Oh, sure, all the time."

    [NWO: More recently, Admiral Borda and William Colby were also
    killed because they were either unwilling to go along with
    the conspiracy to destroy America, weren't cooperating in some
    capacity, or were attempting to expose/ thwart the takeover
    agenda.]

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    This is just a reminder.
    It is not an emergency yet.
    Were it actual emergency, you wouldn't be able to read this.
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Lew, Aug 3, 2008
    #15
  16. Lew

    Christian Guest

    Tom Anderson schrieb:
    > On Sat, 2 Aug 2008, Christian wrote:
    >
    >> Daniel Pitts schrieb:
    >>> puzzlecracker wrote:
    >>>>> Item 25 of Effective Java 2nd Edition (Bloch): Prefer lists to arrays.
    >>>>>
    >>>>> Lists are a higher level abstraction, and therefor "easier" to work
    >>>>> with.
    >>>>
    >>>> and slower to work with...
    >>>>
    >>> Premature optimization is the root of all evil.
    >>>
    >>> Lists are marginally slower to work with than arrays, but who cares
    >>> if your program is fast when it doesn't work correctly?

    >>
    >> Until now the only reason to optimize collections away for arrays was
    >> never the speed but allways the RAM usage for me.
    >>
    >> If you know that you will be holding about 100k to 1 Mio collections
    >> .. then the overhead of the collections is enormous an using arrays
    >> becomes a must.
    >>
    >> ie
    >> HashSet 1 obj holding an hashmap 12byte
    >> HashMap 1 obj holding 8 Byte
    >> 3*int+1 float 16
    >> entry array+map entrys 8+n*4 + n*Entry bytes
    >>
    >> Entry: 8 Bytes
    >> + 3 object references 12 Byte
    >> + 1 int 4 Byte
    >>
    >> so hashset:
    >> 44+ n*28 byte
    >> (due to the load factor of the hasmap it would be even some bytes more..)
    >>
    >> in comparison to just an array: 8+ n*4 bytes

    >
    > And how exactly do you search or insert into this array?
    >
    > tom
    >

    Searching with binary search ... as implemented in Arrays class..

    inserting creating a new array using data of the binarys search
    shifting all entrys afterwards..

    Yes it is slower. Bit if the arrays/sets come en masse and are rather
    small , may be less than 500 entrys one won't notice it that much.

    This example I made is really only important to show that even if
    Collections are superior usually. My experience till now was that the
    reason to choose arrays over Collection (no matter if set or list or
    map) were always due to storage. There has never ever been a problem
    with speed for me due to collections.

    As others pointed out ArrayList has less overhead than map or set.
    Yes thats true .. but sometimes you need a Set or Map and usually I use
    HashSet and HashMap for this. But sometimes an array can replace those.
    Especially if the key for the map is part of the Object mapped it can
    easier be put into an array as one doesn't need any special Entry
    objects holding key and mapped object.

    Again this is optimisation that should not be done prematurely.
    Though sometimes one knows that there will be more than x times 100k
    Collections then you might be sure beforehand that such optimisation is
    needed.

    Christian
    Christian, Aug 3, 2008
    #16
  17. Lew

    Tom Anderson Guest

    On Sun, 3 Aug 2008, Christian wrote:

    > Tom Anderson schrieb:
    >> On Sat, 2 Aug 2008, Christian wrote:
    >>
    >>> Daniel Pitts schrieb:
    >>>> puzzlecracker wrote:
    >>>>>> Item 25 of Effective Java 2nd Edition (Bloch): Prefer lists to arrays.
    >>>>>>
    >>>>>> Lists are a higher level abstraction, and therefor "easier" to work
    >>>>>> with.
    >>>>>
    >>>>> and slower to work with...
    >>>>>
    >>>> Premature optimization is the root of all evil.
    >>>>
    >>>> Lists are marginally slower to work with than arrays, but who cares if
    >>>> your program is fast when it doesn't work correctly?
    >>>
    >>> Until now the only reason to optimize collections away for arrays was
    >>> never the speed but allways the RAM usage for me.

    >>
    >> And how exactly do you search or insert into this array?

    >
    > Searching with binary search ... as implemented in Arrays class..
    >
    > inserting creating a new array using data of the binarys search shifting all
    > entrys afterwards..


    Yikes. That sounds reasonable for lookup - it's O(log N), rather than a
    hashset's O(1), but still not too bad. But insertion will be very slow
    indeed.

    > Yes it is slower. Bit if the arrays/sets come en masse and are rather
    > small , may be less than 500 entrys one won't notice it that much.


    As Lew keeps pointing out, if we're talking about small tables, then space
    efficiency doesn't matter too much.

    > This example I made is really only important to show that even if
    > Collections are superior usually. My experience till now was that the
    > reason to choose arrays over Collection (no matter if set or list or
    > map) were always due to storage. There has never ever been a problem
    > with speed for me due to collections.


    I would agree that the space overhead in a HashSet is excessive. It would
    be good to have a leaner one that doesn't just wrap a HashMap, and so
    saves a word per entry. It would also be good to have a very
    space-efficient SortedArraySet, like the way you manage arrays, for when
    you have a huge structure that is infrequently updated.

    Or perhaps a HashMap/HashSet that uses linear probing rather than
    collision lists, which would save even more memory. It is even possible to
    do away with the Entry objects altogether in that case, although only by
    giving up cacheing of the hashcode (which is actually not such a big deal
    if your keys cache the hashcode anyway, as strings do).

    tom

    --
    unstable orbits in the space of lies
    Tom Anderson, Aug 3, 2008
    #17
  18. Lew

    zerg Guest

    Lew wrote:
    [snip]

    Okay. Which one of you wise guys infected Lew with that Cardassian
    aphasia virus? That's two posts like this and counting...
    zerg, Aug 3, 2008
    #18
  19. zerg wrote:
    > Lew wrote:
    > [snip]
    >
    > Okay. Which one of you wise guys infected Lew with that Cardassian
    > aphasia virus? That's two posts like this and counting...


    This has already been established several times. A crackpot (we believe
    it's the NewsMaestro guy) has been following Lew and Andrew Thompson
    around and inserting messages with Supercedes: headers to reduce their
    posts to gibberish.

    Those of us fortunate to have news servers which do not respect said
    headers can merely killfile the extraneous posts, while those with such
    servers can only complain. Or wait until the crackpot gets bored of this
    (I've been predicting 12-18 mos, but that's still a long time).

    --
    Beware of bugs in the above code; I have only proved it correct, not
    tried it. -- Donald E. Knuth
    Joshua Cranmer, Aug 3, 2008
    #19
  20. Lew

    Arne Vajhøj Guest

    zerg wrote:
    > Lew wrote:
    > [snip]
    >
    > Okay. Which one of you wise guys infected Lew with that Cardassian
    > aphasia virus? That's two posts like this and counting...


    Try and read various other threads.

    Lew did not post that.

    Some weird guy think it is funny to supersede Lews posts
    with another post with random words inserted.

    Arne
    Arne Vajhøj, Aug 3, 2008
    #20
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Juergen Berchtel
    Replies:
    1
    Views:
    5,986
    John C. Bollinger
    May 20, 2005
  2. Replies:
    4
    Views:
    392
    Daniel Pitts
    Oct 1, 2007
  3. Todd
    Replies:
    1
    Views:
    435
    Stefan Ram
    Aug 15, 2008
  4. Philipp
    Replies:
    21
    Views:
    1,123
    Philipp
    Jan 20, 2009
  5. Soul
    Replies:
    0
    Views:
    513
Loading...

Share This Page