A List of One. - Page 2

•  Subject
• Author
• Posted on

Re: A List of One.

declaimed:

Hehe, here's one of my favorite narratives related to the subject extant.

A helicopter was flying around above Seattle yesterday when an electrical
malfunction disabled all of the aircraft's electronic navigation and
communications equipment. Due to the clouds and haze, the pilot could not
determine the helicopter's position and course to steer to the
airport. The pilot saw a tall building, flew toward it, circled, drew a
hand-written sign, and held it in the helicopter's window. The pilot's sign
read "WHERE AM I?" in large letters. People in the tall building quickly
responded to the aircraft, drew a large sign, and held it in a building
window. Their sign read "YOU ARE IN A HELICOPTER." The pilot smiled, waved,
looked at his map, determined the course to steer to SEATAC
airport, and landed safely. After they were on the ground, the copilot
asked the pilot how the "YOU ARE IN A HELICOPTER" sign helped
determine their position. The pilot responded "I knew that had to be the
MICROSOFT building because, similar to their help-lines, they gave
me a technically correct but completely useless answer."

--
Neredbojias
Infinity can have limits.

Re: A List of One.

The reason for starting indexing from 0 in most programming languages is that
at the level of machine-language implementation, indexing is a matter of
adding the index value, possibly multiplied by a constant, to a base address.
We can consider this at a more logical level, too: we could _define_ an
indexed variable as a shorthand for adding a displacement. In C terms,
a[i] is equivalent to *(a+i), thanks to indexes starting from zero.

This is also reflected in HTML. In client-side image maps, the coordinate
values used in <area> elements are indexes in a sense, and they start from
zero, i.e. the upper left corner of the image is (0,0).

Astonishingly, the HTML 4.01 specification "Errata" says:

"15. It is not specified whether the values of the "coords" attribute (A and
AREA elements) are 0-based or 1-based
Added: 12 May 2001
Type: Error
Refers to: 24 Dec 1999 version, section 13.6.1 AREA element declaration.
Description: The specification is unclear about whether x,y coordinates are
0-based or 1-based. Is the top left corner (0,0) or (1,1)?
Correction: None yet (seeking HTML WG input)."

After about five years, they still haven't decided on this. This confusion is
quite unnecessary, since starting from (0,0) is the only sensible way, and
the examples in the specification make it clear that (0,0) shall it be.

--
Yucca, http://www.cs.tut.fi/~jkorpela /
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Re: A List of One.

snip

I agree it is very sensible. Measuring almost anything, it is
most natural and practical to start at 0.

In Sudoku, where there are but ten kinds of (any type of) things,
it is particularly sensible to use 0-9. It has the elegance of
each item being quite unique and of similar size ("10" being
bigger than "9" in look and, furthermore, a composite of "0" and
"1"  which, potentially confusedly, repeats elements already
used). In this example, there are just ten items and no
particular order, 0 is neither the first nor the tenth. Not in
Sudoku at least.

--
dorayme

Re: A List of One.

Neredbojias wrote:

Ususally this is for historical and practical purposes.

An array is often represented in memory as a single number that points to
a location in memory. So the array "myvar[]" might refer to address "1000"
in memory.

If we want to retrieve the first item of the array, we can find it at
memory address 1000. If we want to retrieve the second item in the array,
it's at address 1001; the third item, at 1002; and so on.

myvar[0] stored at 1000+0
myvar[1] stored at 1000+1
myvar[2] stored at 1000+2
etc

So retrieving an array item would be implemented internally by the
programming language like this:

function retrieve_item (array, index)
{
data_width = size_of(data_type_of(array));
address = address_of(array) + (index * data_width);
return retrieve_bytes(index, data_width);
}

Anyway, that's how arrays were implemented in many older programming
languages, and still are in lower-level languages like C. Modern,
higher-level languages don't tend to implement arrays like this, but
retain 0-based indexes because that's what programmers are used to.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me  ~ http://tobyinkster.co.uk/contact

Re: A List of One.

To further the education of mankind, Toby Inkster

As I said - a sop to the geeks.  But it's interesting that by starting
storage at some "round" number such as 1000, one leaves 999 memory
addresses before it.  Further, elemental computer communication is done
in binary which may be "up-verted" to hexadecimal, neither of which holds
decimal 1000 to be a "round" number.  In other words, the procedure is
just a sloppy programming technique.

In spite of all this, yes, "0" is not actually a value like any normal
ordinal number.  However, you must have zero *something*.  You can't have
zero *nothing*.  I believe that's why the geek-boys call "null" a special
value.  It doesn't say "I don't have any of these"; it says "there is no
'these' to begin with."

--
Neredbojias
Infinity can have limits.

Re: A List of One.

Neredbojias wrote:

1000 was just for the purposes of illustration. The array could equally
be stored at address 0, or 6, or 21890 -- it's not a matter for the
programmer to worry unduly about -- compilers tend to do a pretty good job
of slotting tonnes of integers, strings, arrays, etc into memory with very
little free space in between.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me  ~ http://tobyinkster.co.uk/contact

Re: A List of One.

To further the education of mankind, Toby Inkster

Sure, I don't dispute that point.  I think we're actually talking about 2
different levels of programmers here, anyway.  My criticism was generally
directed at those programmers who do things "expediently" rather than
thoroughly and properly.  A short while ago some kind of wp files were
being discussed wherein you could save a single word and still have
something like a 12k file on disc.  I happen to know Wordstar never really
made the transition from DOS to Windows for that very reason.

--
Neredbojias
Infinity can have limits.

Re: A List of One.

Microsoft Word is more compact?

Jose
--
The price of freedom is... well... freedom.
for Email, make the obvious change in the address.

Re: A List of One.

declaimed:

I don't know much about word-processors since I insist on using only text-
editors for anything and everything, and I suspect that MS Word is quite
"bloating" in its own right, but WS for Windows was horrible.  I remember
playing with it and building-up a 384k file with just a handful of
paragraphs.

--
Neredbojias
Infinity can have limits.

Re: A List of One.

Neredbojias arranged shapes to form:

Ok, so say you've got an array in PHP, Perl, Javascript or whatever, and
you're going to output it to HTML. If the array is empty - should we output
nothing at all because there is no list, or output <ul></ul> to denote that
the set is there?

--

Davémon
http://www.nightsoil.co.uk /

Re: A List of One.

declaimed:

...

What is output is irrelevant to the discussion.  Sometimes you may wish to
have a list populated with "0"s, sometimes not.  The significant thing is
that the array, even if empty, is defined and, hence, exists.

--
Neredbojias
Infinity can have limits.

Re: A List of One.

Does make sense to me.

<p>My current to do list is:</p>
<ul></ul>

conveys more meaning than:

<p>My current to do list is:</p>

which merely seems like an incomplete statement.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me  ~ http://tobyinkster.co.uk/contact

Re: A List of One.

Toby Inkster arranged shapes to form:

Both are incomplete statements.

Surely, in preference you'd have something like

<p>My current to do list is empty!</p>

or even:

<p>My current to do list is:</p>
<ul>
<li>Update to do list</li>
</ul>
;-)

--

Davémon
http://www.nightsoil.co.uk /

Re: A List of One.

No, TI is right.

You need to distinguish between the semantic effect of the two.
One is incomplete. The other is not. In the one, one can see
there is nothing to be done. In the other, one is waiting for the
speaker or writer to go on and complete the sentence. One has a
whole meaning, the other is incomplete in meaning.

Anyway, that is how I see it, but I appreciate some will not find
this so comfortable. I like and feel comfortable with empty sets.
It truly helps in handling the mad existential claims of the
majority of earthlings... :)

--
dorayme

Re: A List of One.

Only because it is a sentence.  How about something like

To Do:
<ul></ul>

Jose
--
The price of freedom is... well... freedom.
for Email, make the obvious change in the address.

Re: A List of One.

Toby Inkster arranged shapes to form:

However, HTML is a language, and I don't think Language and Mathematics are
directly comparable.

For example, in maths, two negatives make a positive, wheras in language
(English at least) two negatives are just emphatically negative. "I don't
know nothing about it".

The other difference between the idea of a list and a set, is that lists
imply an order, even an unordered list <ul> still retains that quality.
Mathematically [set] that order isn't important, but in terms of language
[lists], the position of the object in realtion to the other objects
invariably is.

If you have either 1 thing, or 0 things, then they can't be sequentially
related to other things, so therefore not lists. I think... ?

--

Davémon
http://www.nightsoil.co.uk /

Re: A List of One.

Davémon" <"davémon wrote in

In lots of ways, they are.

That's a double negative - it means the positive: if I don't know *nothing*
about it then I do know *something* about it.

--
PeterMcC
If you feel that any of the above is incorrect,
inappropriate or offensive in any way,
please ignore it and accept my apologies.

Re: A List of One.

PeterMcC arranged shapes to form:

Among the people who use the phrase, double negatives of that kind are
simply emphatic, and it is /always/ understood and used as such.

--

Davémon
http://www.nightsoil.co.uk /

Re: A List of One.

Davémon" <"davémon wrote in

/Always/ might be a bit difficult to maintain, though I'd be unreasonable to
not allow a little hyperbolic licence :)

I agree with you entirely about usage, there are countless utterances whose
understood meaning is not that which is literally signified by the words and
syntax used.

We see poorly structured maths, HTML, Perl, etc. that is understood by those
who produced it - and those who look at it also understand what the writer
intended to convey.

The syntax and logic of the declarative "I don't know nothing" is, I think,
clear in its literal sense.

Then, what do I know?

;)

--
PeterMcC
If you feel that any of the above is incorrect,
inappropriate or offensive in any way,
please ignore it and accept my apologies.

Re: A List of One.

PeterMcC arranged shapes to form:

Among the people who use the phrase, always.

That's very true - the encoder and decoder need to have the same
understanding of the code which is being used.

With that in mind, syntactically, what does:

<ul>
<li>Oak.</li>
</ul>

convey to you that

<p>Oak.</p>

doesn't?

I agree, but logic and syntax is of no help at all in understanding its
more common correct figurative use. Is there a similar way to use maths in
a figurative way? Does context change maths as it does language, so that
1+1 != 2 somewhere in the universe? That would make them directly
comparable.

Hmm. I like the idea of using HTML for presentational purposes as being "a
figurative use of the language".

I don't know!

--

Davémon
http://www.nightsoil.co.uk /