Setting based 1 Arrays

  • Thread starter Thread starter Mike
  • Start date Start date
Tom,

Under the covers List(Of T) and ArrayList are simply arrays. They just
resize
their selves as they grow in an intelligent fashion.

--
In my idea is this impossible, I assume that it is nothing more than a list
of objects in chunks with references to objects etc.

It is a old concept the first reference is to the previous chunk the last to
the next chunk.
(However I never investigated it in Net)

For that you need only one starting place the rest can be allocated at any
time.

An array is a part of the memory that has a length of (item length * array
length)

Cor
 
Tom,


In my idea is this impossible, I assume that it is nothing more than a list
of objects in chunks with references to objects etc.

Nope. Both array list and List(Of T) are wrappers around simple arrays. They
just intelligently resize (redim preserve in VB speak) when you add elements
and it runs out of room. Basically, length + length * 2.
 
Are you saying if I insert an element at the bottom of a million item List
then it will just copy a huge array up 1 element? Yikes!

That's exactly what it would do. It pays to look at the performance
characteristics of a collection before you use it.
 
Tom said:
That's exactly what it would do.

It depends if the growth amount has been exceeded. Collections I am
experienced with have a growth size.
It pays to look at the performance
characteristics of a collection before you use it.

Absolutely. As with most things that at collected at the item level.
In general, the issue is more of the memory management. I guess, VB
as well as its kissing cousin, VB++ <g>, has a long history and its GC
has been fine tuned. But having more control of the memory, when
necessary, is sometimes useful, especially when dealing with complex
types vs natural types.

In collection classes, using it has growth size helps with memory
fragmentation and optimization.

Also, if one has to deal with a "million" items in memory, well, it
probably means you have to redesign that part of the application,
especially if collection manipulation is part of the logic. Keeping
that amount in virtual memory is a lot for ANY language to deal with.

One approach in dealing with "large" list, again is sparse matrices,
which is the basic idea behind spreadsheets. Excel doesn't save a X
by Y table - it only stores what the cells that are used.

http://en.wikipedia.org/wiki/Sparse_matrix

Overall, in my system and product design experience, a "collection" is
more of a read only idea. Manipulation is needed, maybe in the form
for sorting, which programmatically, if you are adding to a list to be
sorted one item at a time, a good programmer should know to turn off
the sorting first, add all the items, then enable the sort when you
are finished.

But all this is CS 101. There are many ways to deal with large data list.

==
 
Michael Williams said:
So do I, but I don't do it here. I do it in the real Visual Basic
newsgroup ;-)

It's time to get over that dinosaur from last century Mike.

Michael
 
In 20+ years of programming I'm yet to find a need for specifying a
custom array lower bound. It's is quite simply not necessary.

Maybe not a need, but certainly plenty of uses.

You are right, in that it is not nessesary, but it does avoid the
requirement for kludges. Especially when it is not nessesary that it be
zero-based.
 
It's time to get over that dinosaur from last century Mike.

Nah, it suits me fine. I'm a dinosaur from the last century myself ;-)
Besides, if I ever did move from using VB6 to something else it certainly
would NOT be VB.Net or indeed anything that is even remotely connected to
Micro$oft's plans for the brave new world of the future where they move
their current protection racket into the rental business.

Mike
 
Michael Williams said:
Nah, it suits me fine. I'm a dinosaur from the last century myself ;-)
Besides, if I ever did move from using VB6 to something else it certainly
would NOT be VB.Net or indeed anything that is even remotely connected to
Micro$oft's plans for the brave new world of the future where they move
their current protection racket into the rental business.

I bought a new iPhone the other day. I cannot put any app on it unless apple
has approved that app. I'd like to download an app to use my iphone as a
modem. But here's the catch, while these apps exist for some bizarre reason
apple don't approve any of them. It seems for 1 reason or another it
interferes with apple's revenue stream. If this was Microsoft there would be
50 apps available and they'd publish registry hacks themselves on how to get
around the limitation. Although I doubt MS would build such a stupid
limitation into their product in the first place. Anyway, my point is that
MS aren't all that bad.

Michael
 
Michael Cole said:
Maybe not a need, but certainly plenty of uses.

You are right, in that it is not nessesary, but it does avoid the
requirement for kludges. Especially when it is not nessesary that it be
zero-based.

I really can't remember ever encountering such a case. The classic example
given is storing data for the years 1970 to 1985 in an array. But this would
only work if I have data for each year and only 1 piece of data per year.
Generally I'd probably create a class storing the year as an element and
create an array of that class.

If we allow non-zero based arrays then we get a performance hit on every
array access for a feature that gets used once in a blue moon.
 
I bought a new iPhone the other day. I cannot put any app on it unless
apple has approved that app . . . It seems for 1 reason or
another it interferes with apple's revenue stream. If this was Microsoft
there would be 50 apps available . . . Anyway, my point is that MS aren't
all that bad.

Apple is a dreadful company. You're quite right there. In fact Micro$oft
look like cute little pussycats when they're standing next to companies like
Apple. If I had any Apple products myself (which I do not) then I would
criticise them as well, more severely than I ever criticise Micro$oft. But
Micro$oft are still a bunch of corporate gangsters, as is evidenced by lots
of things they do, especially by their nasty behaviour in Nigeria. Being one
of the less aggressive gangsters does mitigate in their favour, but it
doesn't change the fact of what they are ;-)

I'll tell you something, we really are extremely lucky that the PC was an
open architecture all those years ago, rather than Micro$oft's own product,
or they really would have screwed us all to the wall by now! MS would dearly
love to own the rights to the PC architecture, and in fact they have been
going out of their way and spending a lot of money lately in their attempts
to subtly persuade people that they do, even though they in fact do not.
Their "I'm a PC" adverts are absolutely silly and thoroughly childish, but
they have a sinister marketing message behind them that is dishonest in its
nature and that is attempting to inextricably link PCs themselves, by their
acronynm, to Micro$oft Windows. They are hoping that the gullible people at
whom their advert is aimed will assume that a PC is not a PC unless it is
running Micro$oft Windows, which is simply not true. Micro$oft are a
thoroughly untrustworthy bunch. They're up to no good, that's for sure.

Mike
 
Michael Williams said:
I'll tell you something, we really are extremely lucky that the PC was an
open architecture all those years ago, rather than Micro$oft's own
product, or they really would have screwed us all to the wall by now! MS
would dearly love to own the rights to the PC architecture, and in fact
they have been going out of their way and spending a lot of money lately
in their attempts to subtly persuade people that they do, even though they
in fact do not. Their "I'm a PC" adverts are absolutely silly and
thoroughly childish, but they have a sinister marketing message behind
them that is dishonest in its nature and that is attempting to
inextricably link PCs themselves, by their acronynm, to Micro$oft Windows

From what I know about the ridiculous "I'm a PC" campaign I consider it a
parody of the stupid "I'm a Mac" ads.
 
From what I know about the ridiculous "I'm a PC" campaign
I consider it a parody of the stupid "I'm a Mac" ads.

I'm glad you agree with me that it is ridiculous. I've not seen the "I'm a
Mac" ads but I assume they're something like the stupid "I'm a PC" ads, with
of course the very real difference that Apple actually do own the rights to
the Mac architecture whereas Micro$oft do NOT own the rights to the PC, even
though they would dearly love to do so and are spending lots of money in
their attempts to dishonestly persuade people that they do. But then that's
exactly what you would expect of a dishonest bunch of corporate gangsters so
I shouldn't really be surprised. Nice to see that you agree.

Mike
 
Michael Williams said:
Apple is a dreadful company. You're quite right there. In fact Micro$oft
look like cute little pussycats when they're standing next to companies
like Apple. If I had any Apple products myself (which I do not) then I
would criticise them as well, more severely than I ever criticise
Micro$oft. But Micro$oft are still a bunch of corporate gangsters, as is
evidenced by lots of things they do, especially by their nasty behaviour
in Nigeria. Being one of the less aggressive gangsters does mitigate in
their favour, but it doesn't change the fact of what they are ;-)

I'll tell you something, we really are extremely lucky that the PC was an
open architecture all those years ago, rather than Micro$oft's own
product, or they really would have screwed us all to the wall by now! MS
would dearly love to own the rights to the PC architecture, and in fact
they have been going out of their way and spending a lot of money lately
in their attempts to subtly persuade people that they do, even though they
in fact do not. Their "I'm a PC" adverts are absolutely silly and
thoroughly childish, but they have a sinister marketing message behind
them that is dishonest in its nature and that is attempting to
inextricably link PCs themselves, by their acronynm, to Micro$oft Windows.
They are hoping that the gullible people at whom their advert is aimed
will assume that a PC is not a PC unless it is running Micro$oft Windows,
which is simply not true. Micro$oft are a thoroughly untrustworthy bunch.
They're up to no good, that's for sure.

It seems your main complaint is that MS charge more in the UK than in the US
for their products? Woop de doo Mike. Pretty much every single company in
the UK charges more for the products and services than just about anywhere
else on the planet. I had to pay 51 pounds a night to stay in some sh! thole
backpackers 20+ks out of london. Over here you can still get backpackers
accomomdation right in the city for $15 (about 7 pound).
 
I had to pay 51 pounds a night to stay in some sh!t hole
backpackers 20+ks out of london. Over here you can
still get backpackers accomomdation right in the city
for $15 (about 7 pound).

You poor soul. I really do feel sorry for you. Perhaps you can bring a
cardboard box with you next time you come over? You should feel comfortable
in that and it will save you dragging your feet all over London in a futile
search for a £7 per night dirt hole of the kind you are used to staying at
in Australia. From my own experiences I have found rooms in fairly decent
Australian hotels to cost something in the region of £70 to £80 per night or
more (ten times what you are used to paying for your own hotel accommodation
it would seem!), unless of course you are prepared to stay in something
considerably less than a three star. That is of course a bit cheaper than
here in the UK (although not massively cheaper) and is what is to be
expected in an arid scrubland country such as Australia where building land
is cheap due to the fact that there are more sheep than people.

Incidentally, my daughter spent about a month in Australia some months ago
and she spent a week in Melbourne, where you live yourself. The hotels there
were not much cheaper than they are here in England, and in fact some of
them were more expensive. The hotel she stayed at in Melbourne was a fairly
average four star hotel and it cost her something in the region of £100
sterling per night, which I personally think is quite expensive for a
country such as Australia which has plenty of arid scrubland for building
and more sheep than people. She did go to a few other places in Australia,
some of which she quite liked, Adelaide for example, but she thought that
Melbourne, where you live yourself, was a very dirty place, especially the
people who were generally extremely uncouth. Many of the restaurants in
particular were very drab, and some of the "down market" eating houses, such
as McDonalds, were dreadful. There were pigeons flying in and out all the
time and there was bird sh!t on the tables and on the chairs and none of the
staff ever bothered to clean it off. None of the Australian customers seemed
to mind that at all, and they happily sat on sh!tty chairs and ate their
food off the sh!tty tables as though they were used to it, which of course
they were. Dreadful place. The hotel she stayed at was quite nice though,
although it did cost her about £100 sterling per night. I really do pity you
for having to stay in sh!tty little backpacker hotels in Australia of the
kind you described at £7 sterling per night. It must be dreadful for you.
Mind you, I suppose you must be used to it living in a dirt hole like
Melbourne.

Mike
 
I had to pay 51 pounds a night to stay in some sh!t hole
backpackers 20+ks out of london. Over here you can
still get backpackers accomomdation right in the city
for $15 (about 7 pound).

You poor soul. I really do feel sorry for you. Perhaps you can bring a
cardboard box with you next time you come over? You should feel comfortable
in that and it will save you dragging your feet all over London in a futile
search for a £7 per night dirt hole of the kind you are used to staying at
in Australia. From my own experiences I have found rooms in fairly decent
Australian hotels to cost something in the region of £70 to £80 per night or
more (ten times what you are used to paying for your own hotel accommodation
it would seem!), unless of course you are prepared to stay in something
considerably less than a three star. That is of course a bit cheaper than
here in the UK (although not massively cheaper) and is what is to be
expected in an arid scrubland country such as Australia where building land
is cheap due to the fact that there are more sheep than people.

Incidentally, my daughter spent about a month in Australia some months ago
and she spent a week in Melbourne, where you live yourself. The hotels there
were not much cheaper than they are here in England, and in fact some of
them were more expensive. The hotel she stayed at in Melbourne was a fairly
average four star hotel and it cost her something in the region of £100
sterling per night, which I personally think is quite expensive for a
country such as Australia which has plenty of arid scrubland for building
and more sheep than people. She did go to a few other places in Australia,
some of which she quite liked, Adelaide for example, but she thought that
Melbourne, where you live yourself, was a very dirty place, especially the
people who were generally extremely uncouth. Many of the restaurants in
particular were very drab, and some of the "down market" eating houses, such
as McDonalds, were dreadful. There were pigeons flying in and out all the
time and there was bird sh!t on the tables and on the chairs and none of the
staff ever bothered to clean it off. None of the Australian customers seemed
to mind that at all, and they happily sat on sh!tty chairs and ate their
food off the sh!tty tables as though they were used to it, which of course
they were. Dreadful place. The hotel she stayed at was quite nice though,
although it did cost her about £100 sterling per night. I really do pity you
for having to stay in sh!tty little backpacker hotels in Australia of the
kind you described at £7 sterling per night. It must be dreadful for you.
Mind you, I suppose you must be used to it living in a dirt hole like
Melbourne.

Mike
 
I had to pay 51 pounds a night to stay in some sh_it
hole backpackers 20+ks out of london. Over here you can
still get backpackers accomomdation right in the city
for $15 (about 7 pound).

You poor soul. I really do feel sorry for you. Perhaps you can bring a
cardboard box with you next time you come over? You should feel comfortable
in that and it will save you dragging your feet all over London in a futile
search for a £7 per night dirt hole of the kind you are used to staying at
in Australia. From my own experiences I have found rooms in fairly decent
Australian hotels to cost something in the region of £70 to £80 per night or
more (ten times what you are used to paying for your own hotel accommodation
it would seem!), unless of course you are prepared to stay in something
considerably less than a three star. That is of course a bit cheaper than
here in the UK (although not massively cheaper) and is what is to be
expected in an arid scrubland country such as Australia where building land
is cheap due to the fact that there are more sheep than people.

Incidentally, my daughter spent about a month in Australia some months ago
and she spent a week in Melbourne, where you live yourself. The hotels there
were not much cheaper than they are here in England, and in fact some of
them were more expensive. The hotel she stayed at in Melbourne was a fairly
average four star hotel and it cost her something in the region of £100
sterling per night, which I personally think is quite expensive for a
country such as Australia which has plenty of arid scrubland for building
and more sheep than people. She did go to a few other places in Australia,
some of which she quite liked, Adelaide for example, but she thought that
Melbourne, where you live yourself, was a very dirty place, especially the
people who were generally extremely uncouth. Many of the restaurants in
particular were very drab, and some of the "down market" eating houses, such
as McDonalds, were dreadful. There were pigeons flying in and out all the
time and there was bird sh_it on the tables and on the chairs and none of
the staff ever bothered to clean it off. None of the Australian customers
seemed to mind that at all, and they happily sat on sh_itty chairs and ate
their food off the sh_itty tables as though they were used to it, which of
course they were. Dreadful place. The hotel she stayed at was quite nice
though, although it did cost her about £100 sterling per night. I really do
pity you for having to live in sh_itty little backpacker hotels at £7
sterling per night! Must be dreadful for you. Mind you, I suppose you must
be used to it living in a dirt hole like Melbourne.

Mike
 
I had to pay 51 pounds a night to stay in some sh_it
hole backpackers 20+ks out of london. Over here you can
still get backpackers accomomdation right in the city
for $15 (about 7 pound).

You poor soul. I really do feel sorry for you. Perhaps you can bring a
cardboard box with you next time you come over? You should feel comfortable
in that and it will save you dragging your feet all over London in a futile
search for a £7 per night dirt hole of the kind you are used to staying at
in Australia. From my own experiences I have found rooms in fairly decent
Australian hotels to cost something in the region of £70 to £80 per night or
more (ten times what you are used to paying for your own hotel accommodation
it would seem!), unless of course you are prepared to stay in something
considerably less than a three star. That is of course a bit cheaper than
here in the UK (although not massively cheaper) and is what is to be
expected in an arid scrubland country such as Australia where building land
is cheap due to the fact that there are more sheep than people.

Incidentally, my daughter spent about a month in Australia some months ago
and she spent a week in Melbourne, where you live yourself. The hotels there
were not much cheaper than they are here in England, and in fact some of
them were more expensive. The hotel she stayed at in Melbourne was a fairly
average four star hotel and it cost her something in the region of £100
sterling per night, which I personally think is quite expensive for a
country such as Australia which has plenty of arid scrubland for building
and more sheep than people. She did go to a few other places in Australia,
some of which she quite liked, Adelaide for example, but she thought that
Melbourne, where you live yourself, was a very dirty place, especially the
people who were generally extremely uncouth. Many of the restaurants in
particular were very drab, and some of the "down market" eating houses, such
as McDonalds, were dreadful. There were pigeons flying in and out all the
time and there was bird sh_it on the tables and on the chairs and none of
the staff ever bothered to clean it off. None of the Australian customers
seemed to mind that at all, and they happily sat on sh_itty chairs and ate
their food off the sh_itty tables as though they were used to it, which of
course they were. Dreadful place. The hotel she stayed at was quite nice
though, although it did cost her about £100 sterling per night. I really do
pity you for having to live in sh_itty little backpacker hotels at £7
sterling per night! Must be dreadful for you. Mind you, I suppose you must
be used to it living in a dirt hole like Melbourne.

Mike
 
Back
Top