473,396 Members | 2,030 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Okay to move an "object" will-nilly?

(My dialect of English seems to puzzle people at times, so I'll first
clarify a few terms which I use in the following post:)

(1) By "domestic", I mean "ordinary, run-of-the-mill, not
extraordinary or strange".

(2) By "willy-nilly", I mean something along the lines of
"haphazardly", but without any sense of recklessness (i.e. gleefully
doing something without expecting any sort of negative effect, even
though there may in fact be a negative effect), e.g. "A child would drink
a glass of liquid left on the kitchen table willy-nilly, blissfully
ignorant as to whether it contained bleach".

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

Okay I'll try to keep the C++ part brief (and yes, my eventual question
is about C):

In C++, there are things called objects. They behave just like
variables, but special things happen when they're created, destroyed,
copied, assigned to, etc.. (specifically, the programmer can specify code
which is to be executed).

If you want to copy an object in C++, is it ill-advised to simply do:

ArbitraryClass original_object;

ArbitraryClass *p = malloc( sizeof *p );

memcpy( p, &original_object, sizeof original_object );
The reason why it's il-advised is that when an object is created, code
can be executed via a "constructor" which may result in the acquisition
of resources such as dynamically allocated memory. If we perform a
"shallow copy" by using "memcpy", then the resulting copy is using the
same resources as the original (when in reality, we want it to get its
own). The matter is remedied by using a copy-constructor... but I won't
get into that here.

Anyway, notwithstanding any of that, I thought it would still be OK in
C++ to move an object in memory, i.e. simply re-locate it. This would
involve memcpy'ing its bytes to a different location and simply not
making any further use of the original. I was told however that this also
is il-advised in C++, because the object's address may be of some
significance to its internal workings (i.e. the special code that gets
executed when you assign to it, destroy it, etc.). A prime example would
be an object which contains a buffer, and which also contains a pointer
to the current position in the buffer, something like:

struct StringStream {

char buffer[1024];

char *p_pos; /* Points to an element of buffer */

};

If we were to move an object of the type "StringStream", then "p_pos"
would effectively become corrupt.

So what's the significance of this?

Recently, I wrote a funky kind of algorithm for sorting an array (whether
it be an array of char's, int's, double's or perhaps a C++ class type),
and the algorithm moved objects around willy-nilly by using memcpy and
discarding the original. However, my algorithm was "broken" in the sense
that it would corrupt objects whose address was of some significance to
their internal workings.

Hence, there is an accepted etiquette in C++ that, when writing re-usable
code such as a sorting algorithm, you DON'T just re-locate objects willy-
nilly, but rather you've to resort to more elustrious means.

My question is:
Does any such etiquette exist in C? If I were writing a domestic
sorting algorithm in C, would it be acceptable for me to re-locate the
objects willy-nilly?
--

Frederick Gotham
Jun 28 '06 #1
33 2279
Frederick Gotham wrote:
<snip>
My question is:
Does any such etiquette exist in C? If I were writing a domestic
sorting algorithm in C, would it be acceptable for me to re-locate the
objects willy-nilly?


Provided nothing was relying on the previously established order of the
the array, yeah sure why not?

Though I should add that even in C++ if you had an array of class
instances you could sort them if you had overloaded the comparison and
assignment operators.

Tom

Jun 28 '06 #2
Frederick Gotham wrote:
In C++, there are things called objects.
In C
int int_object;
is a declaration of an object named int_object.
I believe that's also true in C++.
I was told however that this also
is il-advised in C++, because the object's address may be of some
significance to its internal workings (i.e. the special code that gets
executed when you assign to it, destroy it, etc.).
FILE type objects are like that in C.
My question is:
Does any such etiquette exist in C? If I were writing a domestic
sorting algorithm in C, would it be acceptable for me to re-locate the
objects willy-nilly?


When there's a problem with copying or overwriting objects,
such as with FILE type objects,
and the objects refered to by string literals,
you would be better off sorting an array of pointers to the objects.

--
pete
Jun 28 '06 #3
Frederick Gotham wrote:
...
struct StringStream {
char buffer[1024];
char *p_pos; /* Points to an element of buffer */
};

If we were to move an object of the type "StringStream", then "p_pos"
would effectively become corrupt.
...
My question is:
Does any such etiquette exist in C? If I were writing a domestic
sorting algorithm in C, would it be acceptable for me to re-locate the
objects willy-nilly?


Depends on the objects and their usage. In general, the answer is no.

Not only the objects may contain pointers that would be invalidated by
the relocation, (as in your own StringStream example,) their addresses
could also be stored in pointers somewhere else in the code and those
would be invalidated.

One more issue: How would you handle the relocation of objects
residing in dynamically allocated memory, either explicitly by calling
malloc() or because the objects were declared as automatic variables?
(The same for mixture of static and dynamic objects.)
Jun 28 '06 #4
Roberto Waltman (in r3********************************@4ax.com) said:

| Frederick Gotham wrote:
|| ...
|| struct StringStream {
|| char buffer[1024];
|| char *p_pos; /* Points to an element of buffer */
|| };
||
|| If we were to move an object of the type "StringStream", then
|| "p_pos" would effectively become corrupt.
|| ...
|| My question is:
|| Does any such etiquette exist in C? If I were writing a domestic
|| sorting algorithm in C, would it be acceptable for me to re-locate
|| the objects willy-nilly?
|
| Depends on the objects and their usage. In general, the answer is
| no.
|
| Not only the objects may contain pointers that would be invalidated
| by the relocation, (as in your own StringStream example,) their
| addresses could also be stored in pointers somewhere else in the
| code and those would be invalidated.
|
| One more issue: How would you handle the relocation of objects
| residing in dynamically allocated memory, either explicitly by
| calling malloc() or because the objects were declared as automatic
| variables? (The same for mixture of static and dynamic objects.)

OTOH, if you changed p_pos to be the size_t displacement into the
buffer of the (first) char of interest, then you may very well be able
to relocate StringStream(s) at will.

--
Morris Dovey
DeSoto Solar
DeSoto, Iowa USA
http://www.iedu.com/DeSoto
Jun 28 '06 #5
On Wed, 28 Jun 2006 09:59:06 GMT, Frederick Gotham
<fg*******@SPAM.com> wrote in comp.lang.c:
(My dialect of English seems to puzzle people at times, so I'll first
clarify a few terms which I use in the following post:)

(1) By "domestic", I mean "ordinary, run-of-the-mill, not
extraordinary or strange".

(2) By "willy-nilly", I mean something along the lines of
"haphazardly", but without any sense of recklessness (i.e. gleefully
doing something without expecting any sort of negative effect, even
though there may in fact be a negative effect), e.g. "A child would drink
a glass of liquid left on the kitchen table willy-nilly, blissfully
ignorant as to whether it contained bleach".

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

Okay I'll try to keep the C++ part brief (and yes, my eventual question
is about C):

In C++, there are things called objects. They behave just like
variables, but special things happen when they're created, destroyed,
copied, assigned to, etc.. (specifically, the programmer can specify code
which is to be executed).

If you want to copy an object in C++, is it ill-advised to simply do:

ArbitraryClass original_object;

ArbitraryClass *p = malloc( sizeof *p );

memcpy( p, &original_object, sizeof original_object );
The reason why it's il-advised is that when an object is created, code
can be executed via a "constructor" which may result in the acquisition
of resources such as dynamically allocated memory. If we perform a
"shallow copy" by using "memcpy", then the resulting copy is using the
same resources as the original (when in reality, we want it to get its
own). The matter is remedied by using a copy-constructor... but I won't
get into that here.

Anyway, notwithstanding any of that, I thought it would still be OK in
C++ to move an object in memory, i.e. simply re-locate it. This would
involve memcpy'ing its bytes to a different location and simply not
making any further use of the original. I was told however that this also
is il-advised in C++, because the object's address may be of some
significance to its internal workings (i.e. the special code that gets
executed when you assign to it, destroy it, etc.). A prime example would
be an object which contains a buffer, and which also contains a pointer
to the current position in the buffer, something like:

struct StringStream {

char buffer[1024];

char *p_pos; /* Points to an element of buffer */

};

If we were to move an object of the type "StringStream", then "p_pos"
would effectively become corrupt.

So what's the significance of this?

Recently, I wrote a funky kind of algorithm for sorting an array (whether
it be an array of char's, int's, double's or perhaps a C++ class type),
and the algorithm moved objects around willy-nilly by using memcpy and
discarding the original. However, my algorithm was "broken" in the sense
that it would corrupt objects whose address was of some significance to
their internal workings.

Hence, there is an accepted etiquette in C++ that, when writing re-usable
code such as a sorting algorithm, you DON'T just re-locate objects willy-
nilly, but rather you've to resort to more elustrious means.

My question is:
Does any such etiquette exist in C? If I were writing a domestic
sorting algorithm in C, would it be acceptable for me to re-locate the
objects willy-nilly?


The C qsort() function does exactly this. If you are sorting an array
of objects, the objects in the array must be move safe. If they are
not move safe, then you will have problems using them after you have
sorted them with qsort(), unless you have the degenerate case where
the array was already sorted so no swaps were performed by the sort.

In the case of your example StringStream structure, it would not be
safe to sort them by qsort(), nor would it be safe to sort them by any
other means that involved swapping.

As others have mentioned, you can define an array of pointers to the
structures, then sort this index array with another level of
indirection.

So C, just like C++, allows you to do some things that might not be
safe. You can use memcpy() or memmove() on C objects, just as you can
on POD objects in C++. It is up to the programmer to determine if the
internal structure of those objects makes the operation useful.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://c-faq.com/
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html
Jun 28 '06 #6
Frederick Gotham said:
(My dialect of English seems to puzzle people at times, so I'll first
clarify a few terms which I use in the following post:)

(1) By "domestic", I mean "ordinary, run-of-the-mill, not
extraordinary or strange".
Canonical.
(2) By "willy-nilly",
That is a contraction of "will-he-nill-he" meaning "whether he wishes it or
whether he doesn't", i.e. "like it or not".
I mean something along the lines of
"haphazardly", but without any sense of recklessness
You appear to mean "arbitrarily".

<snip>
And now a brief observation on the actual question. :-)
My question is:
Does any such etiquette exist in C? If I were writing a [canonical]
sorting algorithm in C, would it be acceptable for me to re-locate the
objects [arbitrarily]?


You haven't any choice, since that's what sorting /does/.

But if you have "deep" data, you'd be better off sorting pointers.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
Jun 28 '06 #7
Frederick Gotham wrote:
(My dialect of English seems to puzzle people at times, so I'll first
clarify a few terms which I use in the following post:)

(1) By "domestic", I mean "ordinary, run-of-the-mill, not
extraordinary or strange".

(2) By "willy-nilly", I mean something along the lines of
"haphazardly", but without any sense of recklessness (i.e. gleefully
doing something without expecting any sort of negative effect, even
though there may in fact be a negative effect), e.g. "A child would drink
a glass of liquid left on the kitchen table willy-nilly, blissfully
ignorant as to whether it contained bleach".


just curious, but which dialect of english is this? I've never seen
"domestic"
used the way you use it.
--
Nick Keighley

Jun 29 '06 #8
Nick Keighley wrote:
Frederick Gotham wrote:
(My dialect of English seems to puzzle people at times, so I'll first
clarify a few terms which I use in the following post:)

(1) By "domestic", I mean "ordinary, run-of-the-mill, not
extraordinary or strange".

(2) By "willy-nilly", I mean something along the lines of
"haphazardly", but without any sense of recklessness (i.e. gleefully
doing something without expecting any sort of negative effect, even
though there may in fact be a negative effect), e.g. "A child would drink
a glass of liquid left on the kitchen table willy-nilly, blissfully
ignorant as to whether it contained bleach".


just curious, but which dialect of english is this? I've never seen
"domestic"
used the way you use it.


I think he should have said "idiolect" rather than "dialect": I too
wouldn't interpret "domestic" that way (although I can see it being
used that way).

--
Chris "not a TAME hedgehog" Dollin
"No-one here is exactly what he appears." G'kar, /Babylon 5/

Jun 29 '06 #9
Nick Keighley posted:
Frederick Gotham wrote:
(My dialect of English seems to puzzle people at times, so I'll first
clarify a few terms which I use in the following post:)

(1) By "domestic", I mean "ordinary, run-of-the-mill, not
extraordinary or strange".

(2) By "willy-nilly", I mean something along the lines of
"haphazardly", but without any sense of recklessness (i.e. gleefully
doing something without expecting any sort of negative effect, even
though there may in fact be a negative effect), e.g. "A child would
drink a glass of liquid left on the kitchen table willy-nilly,
blissfully ignorant as to whether it contained bleach".


just curious, but which dialect of english is this? I've never seen
"domestic"
used the way you use it.

English as spoken in Dublin in Ireland. It's true that some of our
grammar and phrases are influenced by the Irish language, but I think our
use of "domestic" is pure English as I can't think off-hand of an
equivalent term in Irish.

We also use the term "domesticated" to indicate that an animal has been
tamed. For instance:

-John was attacked by dogs down by the lake.
-Were they wild dogs?
-No, domesticated.
All the forms of "domestic" indicate (to us in anyway) something which is
commonplace and not extraordinary.
--

Frederick Gotham
Jun 29 '06 #10
On Thu, 29 Jun 2006 14:40:43 GMT, Frederick Gotham
<fg*******@SPAM.com> wrote:
Nick Keighley posted:
Frederick Gotham wrote: <snip>
(1) By "domestic", I mean "ordinary, run-of-the-mill, not
extraordinary or strange".

<snip>

Since it's already consumed far too much time and space, I suggest
that you just use "ordinary", which I think everyone agrees on.

--
Al Balmer
Sun City, AZ
Jun 29 '06 #11
Al Balmer posted:
On Thu, 29 Jun 2006 14:40:43 GMT, Frederick Gotham
<fg*******@SPAM.com> wrote:
Nick Keighley posted:
Frederick Gotham wrote:<snip> (1) By "domestic", I mean "ordinary, run-of-the-mill, not
extraordinary or strange".

<snip>

Since it's already consumed far too much time and space, I suggest
that you just use "ordinary", which I think everyone agrees on.

I disagree. It seems blatantly obvious that people are engaging in this
discussion purely out of curiosity and interest -- and that doesn't
constitute wasted time or space.

Feel free to killfile the thread if you like (if there's such a facility!).

--

Frederick Gotham
Jun 29 '06 #12
In article <LD*******************@news.indigo.ie>,
Frederick Gotham <fg*******@SPAM.com> wrote:
We also use the term "domesticated" to indicate that an animal has been
tamed. For instance: -John was attacked by dogs down by the lake.
-Were they wild dogs?
-No, domesticated. All the forms of "domestic" indicate (to us in anyway) something which is
commonplace and not extraordinary.


"domestic" is a shortened form of the Latin "domesticus" which is
derived from "domus" meaning house. The dogs in the example above
are domesticated because they live around humans, around human
habitation. Things likely to be found around houses are more likely
to be commonplace and not extraordinary, but it is possible, for example,
to have a domesticated leopard or boa constrictor.

In the Oxford English Dictionary (oed.com), *none* of the shades of
meaning of "domestic" (including in the latest drafts) is listed as
pertaining to that which is commonplace and ordinary.

Thus, I would judge that your use of "domestic" is a -relatively-
localized extension, which would be likely to confuse most people.
--
"It is important to remember that when it comes to law, computers
never make copies, only human beings make copies. Computers are given
commands, not permission. Only people can be given permission."
-- Brad Templeton
Jun 29 '06 #13
Walter Roberson posted:

All the forms of "domestic" indicate (to us in anyway) something which
is commonplace and not extraordinary.


"domestic" is a shortened form of the Latin "domesticus" which is
derived from "domus" meaning house. The dogs in the example above
are domesticated because they live around humans, around human
habitation. Things likely to be found around houses are more likely
to be commonplace and not extraordinary, but it is possible, for
example, to have a domesticated leopard or boa constrictor.

In the Oxford English Dictionary (oed.com), *none* of the shades of
meaning of "domestic" (including in the latest drafts) is listed as
pertaining to that which is commonplace and ordinary.

Thus, I would judge that your use of "domestic" is a -relatively-
localized extension, which would be likely to confuse most people.

Actually, this thread has opened my eyes to something.

I've never thought of the word "domestic" as meaning "from home" or "from
this nation or country"... and only now do I see that that's how
American's tend to use the word.

Take the term, "domestic violence"; I always used to think that it meant
"common, everyday violence", but now it seems as though it actually means
"violence in the home". Am I right?
--

Frederick Gotham
Jun 29 '06 #14
Frederick Gotham wrote
Actually, this thread has opened my eyes to something.

I've never thought of the word "domestic" as meaning "from home" or "from
this nation or country"... and only now do I see that that's how
American's tend to use the word.

Take the term, "domestic violence"; I always used to think that it meant
"common, everyday violence", but now it seems as though it actually means
"violence in the home". Am I right?


That's the only meaning I understood for that expression.
(Not an American, but living in the USA.)

Jun 29 '06 #15
Frederick Gotham said:

<snip>
I've never thought of the word "domestic" as meaning "from home" or "from
this nation or country"... and only now do I see that that's how
American's tend to use the word.
It's how the British use the word, too - especially those with a Latin
O-level lurking in their background.
Take the term, "domestic violence"; I always used to think that it meant
"common, everyday violence",
No, the term for that is "football".
but now it seems as though it actually means "violence in the home".


That's precisely what it means, yes.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
Jun 29 '06 #16
Frederick Gotham wrote:
Walter Roberson posted:

All the forms of "domestic" indicate (to us in anyway) something which
is commonplace and not extraordinary.
"domestic" is a shortened form of the Latin "domesticus" which is
derived from "domus" meaning house. The dogs in the example above
are domesticated because they live around humans, around human
habitation. Things likely to be found around houses are more likely
to be commonplace and not extraordinary, but it is possible, for
example, to have a domesticated leopard or boa constrictor.

In the Oxford English Dictionary (oed.com), *none* of the shades of
meaning of "domestic" (including in the latest drafts) is listed as
pertaining to that which is commonplace and ordinary.

Thus, I would judge that your use of "domestic" is a -relatively-
localized extension, which would be likely to confuse most people.

Actually, this thread has opened my eyes to something.

I've never thought of the word "domestic" as meaning "from home" or "from
this nation or country"... and only now do I see that that's how
American's tend to use the word.


I've never seen the word used any other way, by American or otherwise.

I took you up on your statement that the definition of domestic has a
different meaning in Ireland by searching for the word on Ireland-only
websites, after reviewing some several dozen uses of the word I am
beginning to think that you are alone in the confusion of its usage as
I didn't see one instance of it used the way you have described, either
that or it has an extremely localized connotation.
Take the term, "domestic violence"; I always used to think that it meant
"common, everyday violence", but now it seems as though it actually means
"violence in the home". Am I right?


Yes, that's what it means in Ireland too:
http://www.womensaid.ie/pages/domestic/domestic.htm

Robert Gamble

Jun 29 '06 #17
Frederick Gotham (in SQ*******************@news.indigo.ie) said:

| Take the term, "domestic violence"; I always used to think that it
| meant "common, everyday violence", but now it seems as though it
| actually means "violence in the home". Am I right?

Right. It's another oxymoron, since the phrase is applied only to
violence between members of a family. I've never heard of the term
used to describe violent treatment of intruders.

--
Morris Dovey
DeSoto Solar
DeSoto, Iowa USA
http://www.iedu.com/DeSoto
Jun 29 '06 #18
On Thu, 29 Jun 2006 15:56:39 GMT, Frederick Gotham
<fg*******@SPAM.com> wrote:
Al Balmer posted:
On Thu, 29 Jun 2006 14:40:43 GMT, Frederick Gotham
<fg*******@SPAM.com> wrote:
Nick Keighley posted:

Frederick Gotham wrote:

<snip>
> (1) By "domestic", I mean "ordinary, run-of-the-mill, not
> extraordinary or strange".

<snip>

Since it's already consumed far too much time and space, I suggest
that you just use "ordinary", which I think everyone agrees on.

I disagree. It seems blatantly obvious that people are engaging in this
discussion purely out of curiosity and interest -- and that doesn't
constitute wasted time or space.

Feel free to killfile the thread if you like (if there's such a facility!).


Nah, I'm currently set to switch threads on subject change, so it just
pops up again. How about we discuss the World Cup matches, instead?

--
Al Balmer
Sun City, AZ
Jun 29 '06 #19
Al Balmer posted:

Nah, I'm currently set to switch threads on subject change, so it just
pops up again. How about we discuss the World Cup matches, instead?

Might have an alogorithm lying around somewhere to calculate odds.

typedef int bool;

unsigned long CalculateOdds( bool TeamIsFromSouthAmerica );
--

Frederick Gotham
Jun 29 '06 #20
Richard Heathfield wrote:
Frederick Gotham said:

<snip>
I've never thought of the word "domestic" as meaning "from home" or "from
this nation or country"... and only now do I see that that's how
American's tend to use the word.


It's how the British use the word, too - especially those with a Latin
O-level lurking in their background.


The same applies to English people without any ability in any foreign
language.
Take the term, "domestic violence"; I always used to think that it meant
"common, everyday violence",


No, the term for that is "football".


That is a comparatively recent and unfortunate development. I say that
as someone who does not like football.
but now it seems as though it actually means "violence in the home".


That's precisely what it means, yes.


Indeed. That is the only meaning that would ever have occurred to me.
--
Flash Gordon, living in interesting times.
Web site - http://home.flash-gordon.me.uk/
comp.lang.c posting guidelines and intro:
http://clc-wiki.net/wiki/Intro_to_clc
Jun 29 '06 #21
Richard Heathfield schrieb:
Frederick Gotham said:
(My dialect of English seems to puzzle people at times, so I'll first
clarify a few terms which I use in the following post:)

(1) By "domestic", I mean "ordinary, run-of-the-mill, not
extraordinary or strange".
Canonical.
(2) By "willy-nilly",


Never heard of.
That is a contraction of "will-he-nill-he" meaning "whether he wishes it or
whether he doesn't", i.e. "like it or not".
I mean something along the lines of
"haphazardly", but without any sense of recklessness


You appear to mean "arbitrarily".


My dictionary translates it to 'unordentlich' (german), which can be
retranslated to slovenly, untidily, sloppy.

Th.
Jun 29 '06 #22
Frederick Gotham wrote:
English as spoken in Dublin in Ireland. It's true that some of our
grammar and phrases are influenced by the Irish language, but I think our
use of "domestic" is pure English as I can't think off-hand of an
equivalent term in Irish.
It really isn't, though. ;)
We also use the term "domesticated" to indicate that an animal has been
tamed. For instance:


Exactly, "brought into the home." You can look it up in the OED if
you want the Proper English definition. "Domestic" means "of the
domicile," which is your home, roughly speaking.

-tom!
Jun 30 '06 #23
Morris Dovey wrote:
Frederick Gotham (in SQ*******************@news.indigo.ie) said:

| Take the term, "domestic violence"; I always used to think that it
| meant "common, everyday violence", but now it seems as though it
| actually means "violence in the home". Am I right?

Right. It's another oxymoron,


I thought an "oxymoron" was a phrase where the terms were contradictory,
like "colourless green" or "beautifully ugly" [1]; I don't see anything
contradictory between "domestic" and "violence". (Alas.)

[1] Not to be confused with "military intelligence", which isn't an
oxymoron, but where /describing/ as such implies a contradiction
suited to the speaker's purposes. So I am led to believe.

--
Chris "you can lead a horse to water, but you can't make it." Dollin
"Life is full of mysteries. Consider this one of them." Sinclair, /Babylon 5/

Jun 30 '06 #24
Frederick Gotham <fg*******@SPAM.com> wrote:
Nick Keighley posted:
Frederick Gotham wrote:
(My dialect of English seems to puzzle people at times, so I'll first
clarify a few terms which I use in the following post:)

(1) By "domestic", I mean "ordinary, run-of-the-mill, not
extraordinary or strange".

(2) By "willy-nilly", I mean something along the lines of
"haphazardly", but without any sense of recklessness (i.e. gleefully
doing something without expecting any sort of negative effect, even
though there may in fact be a negative effect), e.g. "A child would
drink a glass of liquid left on the kitchen table willy-nilly,
blissfully ignorant as to whether it contained bleach".


just curious, but which dialect of english is this? I've never seen
"domestic" used the way you use it.


English as spoken in Dublin in Ireland. It's true that some of our
grammar and phrases are influenced by the Irish language, but I think our
use of "domestic" is pure English as I can't think off-hand of an
equivalent term in Irish.


It may be pure Ireland-mutated English, but as normal English I'm afraid
both of those are beyond the pale.

Richard
Jun 30 '06 #25
Chris Dollin (in e8**********@malatesta.hpl.hp.com) said:

| Morris Dovey wrote:
|
|| Frederick Gotham (in SQ*******************@news.indigo.ie) said:
||
||| Take the term, "domestic violence"; I always used to think that it
||| meant "common, everyday violence", but now it seems as though it
||| actually means "violence in the home". Am I right?
||
|| Right. It's another oxymoron,
|
| I thought an "oxymoron" was a phrase where the terms were
| contradictory, like "colourless green" or "beautifully ugly" [1]; I
| don't see anything contradictory between "domestic" and "violence".
| (Alas.)

I guess it might matter if "domestic" meant "of the house" or "of the
home". If the latter, I perceive a strong contradiction - but I'm not
sure that distinction is made universally.

| [1] Not to be confused with "military intelligence", which isn't an
| oxymoron, but where /describing/ as such implies a contradiction
| suited to the speaker's purposes. So I am led to believe.

It's a play on the word "intelligence", of course. I spent a few years
in MI and those on the inside would generally agree that it _is_ an
oxymoron. :-)

--
Morris Dovey
DeSoto Solar
DeSoto, Iowa USA
http://www.iedu.com/DeSoto
Jun 30 '06 #26
On Fri, 30 Jun 2006 08:24:28 -0500, "Morris Dovey" <mr*****@iedu.com>
wrote:
Chris Dollin (in e8**********@malatesta.hpl.hp.com) said:

| Morris Dovey wrote:
|
|| Frederick Gotham (in SQ*******************@news.indigo.ie) said:
||
||| Take the term, "domestic violence"; I always used to think that it
||| meant "common, everyday violence", but now it seems as though it
||| actually means "violence in the home". Am I right?
||
|| Right. It's another oxymoron,
|
| I thought an "oxymoron" was a phrase where the terms were
| contradictory, like "colourless green" or "beautifully ugly" [1]; I
| don't see anything contradictory between "domestic" and "violence".
| (Alas.)

I guess it might matter if "domestic" meant "of the house" or "of the
home". If the latter, I perceive a strong contradiction - but I'm not
sure that distinction is made universally.
That is my (and most dictionaries) definition. E.g. "Of or relating to
the family or household." The concept is scaled up to include larger
"families", thus we have domestic wine and domestic foodcrops, as
opposed to imported.
| [1] Not to be confused with "military intelligence", which isn't an
| oxymoron, but where /describing/ as such implies a contradiction
| suited to the speaker's purposes. So I am led to believe.

It's a play on the word "intelligence", of course. I spent a few years
in MI and those on the inside would generally agree that it _is_ an
oxymoron. :-)


--
Al Balmer
Sun City, AZ
Jun 30 '06 #27
On Fri, 30 Jun 2006 09:03:06 GMT, in comp.lang.c ,
rl*@hoekstra-uitgeverij.nl (Richard Bos) wrote:
It may be pure Ireland-mutated English, but as normal English I'm afraid
both of those are beyond the pale.


Quite literally, as it happens. I assume you know where the expression
"beyond the pale" comes from? :-)
--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
Jun 30 '06 #28
In article <OE*************@news.uswest.net>,
Morris Dovey <mr*****@iedu.comwrote:
....
>It's a play on the word "intelligence", of course. I spent a few years
in MI and those on the inside would generally agree that it _is_ an
oxymoron. :-)
The word has (at least) two distinct meanings:
1) The ability (to think/reason/etc - generally, acquire
knowledge/information). This is the most common sense.
2) knowledge/information itself (as a commodity). This is the
sense in which the term MI is used.

Jul 10 '06 #29
In article <7c********************************@4ax.com>,
Al Balmer <al****************@att.netwrote:
....
>That is my (and most dictionaries) definition. E.g. "Of or relating to
the family or household." The concept is scaled up to include larger
"families", thus we have domestic wine and domestic foodcrops, as
opposed to imported.
Agreed. First, in the context of the OP (in both senses of that term),
it was certainly an odd choice of word (particularly in the
anal-retentive environment known as clc), but we all got a laugh out of it.
And that's the important thing!

Second, m-w gives this def'n:

4 : devoted to home duties and pleasures <leading a quietly domestic life>

which I could imagine as being "almost there". I would *not* be surprised
to learn that this is, in fact, acceptable usage in Dublin Irish English.

Jul 10 '06 #30
Frederick Gotham wrote:
struct StringStream {
char buffer[1024];
char *p_pos; /* Points to an element of buffer */
};

If I were writing a domestic sorting algorithm in C, would it be
acceptable for me to re-locate the objects willy-nilly?
No:
1) It could corrupt the object (eg. if it were a struct
StringStream).
2) There may be pointers to the current objects.
3) You don't know how the objects should be allocated.

Jul 11 '06 #31
Frederick Gotham wrote:
Walter Roberson posted:
>>
"domestic" is a shortened form of the Latin "domesticus" which is
derived from "domus" meaning house.

I've never thought of the word "domestic" as meaning "from home" or "from
this nation or country"... and only now do I see that that's how
American's tend to use the word.

Take the term, "domestic violence"; I always used to think that it meant
"common, everyday violence", but now it seems as though it actually means
"violence in the home". Am I right?
Another common usage is "domestic terminal" vs. "international
terminal" at the airport.

Jul 11 '06 #32
Old Wolf posted:

3) You don't know how the objects should be allocated.

"malloc" returns a pointer to a byte in memory which is a suitable starting
location for an object of any type.

But yes, if I were to use a simple local automatic storage char array, I'd be
in trouble.

--

Frederick Gotham
Jul 11 '06 #33
Frederick Gotham wrote:
Old Wolf posted:
3) You don't know how the objects should be allocated.

"malloc" returns a pointer to a byte in memory which is a suitable starting
location for an object of any type.

But yes, if I were to use a simple local automatic storage char array, I'd be
in trouble.
They could also be allocated with a custom allocator, and/or
the system might not support malloc.

Jul 11 '06 #34

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Arne Kösling | last post by:
Hi ! I am new to Web Services. Therefore I ve set up a PHP Installation on Windows (PHP 4.3.2 and Apache 1.3.29). I have tested PHP alone and then installed PEAR. Now I am stuck there (Before...
22
by: Dr Duck | last post by:
GDay all, Something seems odd to me.... I wrote a simple C# function public void bind(ref object a, ref object b, bool atob) { if(atob) b = a; else
7
by: Ryan Park | last post by:
Hi, //SITUATION I got a panel control that hold a certain position on a form. Every controls or UIs are on this panel. At certain situation, I called dispose() method of this panel control...
11
by: Florian Loitsch | last post by:
I'm currently writing a JS->Scheme compiler (which, using Bigloo, automatically yields a JS->C, JS->JVM, JS->.NET compiler), and have a question concerning the function-parameters: According to...
1
by: putty | last post by:
I found a few posts of people asking about insertCell()/insertRow() not working in IE6 SP2, and a few others about getting "null is null or not an object" errors, but no one posted a solution...
4
by: lars.uffmann | last post by:
Hey everyone! I am (still) working on a project that I took over from former students, so don't blame me for the criminal approach on coding *g* The problem I have is fairly easy and while I...
2
by: Rajat Tandon | last post by:
Hi, I have a grid which is continuously updating by the data from a external event. When I close the form on which the grid is placed, then it gives the error message ... "Can not access a...
0
by: =?Utf-8?B?SkhhbGV5?= | last post by:
Our system is: IIS Server: dual Intel Xeon 2.80 GHz, 4 GB Ram Windows Server 2003 SP2 IIS 6.0 SQL Server: dual Intel Xeon 2.80 GHz, 4 GB Ram (separate server) Windows Server 2003 SP2 SQL...
6
by: cleary1981 | last post by:
I have adapted code from http://dunnbypaul.net/js_mouse/ I want to use a button to create new draggable divs but i keep getting error "is null or not an object" heres the code <html> <head>...
3
by: Sarah | last post by:
Hi - Please be gentle. I am quite new to visual basic, but I have been going through tutorials and reading up. I found a code snippet on the internet that I wanted to see if I could re-purpose...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.