www.emsdn.com
Class Profile: Home »» C/C++ [C/C++] under "C/C++" »»» economizing with functions that do the same thing

economizing with functions that do the same thing


About a month ago, Heathfield posted the peudosource for random permuting
from TACP. It was all of maybe five lines. You needed to be able to do
two things: be able to get a random number in a range and swap. I
remembered that Dan Pop taught me to write the swap as a macro. With forum
improvements, this became:
#define SWAP(m, n) (tmp = (m), (m) = (n), (n) = tmp)
The random number comes, again with forum improvements:
int rand_in_range(int m, int n)
{
/*seed srand in main */
/* [m, n] is range */
int roll_again_threshold, divisor, result, tmp, offset, num_results;
if (m>n) SWAP(m, n);
offset = m;
num_results = n - m + 1;
if (num_results == 1) {
return m;
}
roll_again_threshold = RAND_MAX - RAND_MAX%num_results;
divisor = ;
do {
result = rand();
} while (result >= roll_again_threshold);
result /= divisor;
return offset + result;
}
But then I starting thinking, and that is, of course, where the trouble
began. I posted elsewhere, and I don't think you need much of a language
background to get the gist of it:
Ich habe zwei Funktionen bei file scope erklaert:
void permute_string(char * m, int n);
void permute_int(int * m, int n);
Sie tun das genau Gleiche, allerdings erstere mit chars und letztere mit
ints. Wie werden diese Funktionen Eine?
Basically, how do I take 2 functions that differ only in the type they
operate on, and make them one? I was advised to use:
void permute (void *data, int n, size_t elsize);
that could be called for an array a with
permute(a, sizeof a / sizeof a[0], sizeof a[0]);
Is this going to work? If it isn't, then the idea is mine. If it will then
it's Erich Fruehstueck's. cheers, furunculus


No. 1# | By Developer Tags User at [2008-5-5] | size: 2238 bytes

"Your Uncle" <invalid@crippled.netwrote in message
news:449c7966$0$31542$ec3e2dad@news.usenetmonster. com
About a month ago, Heathfield posted the peudosource for random permuting
from TACP. It was all of maybe five lines. You needed to be able to do
two things: be able to get a random number in a range and swap. I
remembered that Dan Pop taught me to write the swap as a macro. With
forum improvements, this became:
#define SWAP(m, n) (tmp = (m), (m) = (n), (n) = tmp)
The random number comes, again with forum improvements:
int rand_in_range(int m, int n)
{
/*seed srand in main */
/* [m, n] is range */
int roll_again_threshold, divisor, result, tmp, offset, num_results;

if (m>n) SWAP(m, n);
offset = m;
num_results = n - m + 1;

if (num_results == 1) {
return m;
}
--
roll_again_threshold = RAND_MAX - RAND_MAX%num_results;
divisor = ;

do {
result = rand();
} while (result >= roll_again_threshold);
result /= divisor;
return offset + result;
}
But then I starting thinking, and that is, of course, where the trouble
began. I posted elsewhere, and I don't think you need much of a language
background to get the gist of it:
Ich habe zwei Funktionen bei file scope erklaert:
void permute_string(char * m, int n);
void permute_int(int * m, int n);
Sie tun das genau Gleiche, allerdings erstere mit chars und letztere mit
ints. Wie werden diese Funktionen Eine?
Basically, how do I take 2 functions that differ only in the type they
operate on, and make them one? I was advised to use:
void permute (void *data, int n, size_t elsize);
that could be called for an array a with
permute(a, sizeof a / sizeof a[0], sizeof a[0]);
Is this going to work? If it isn't, then the idea is mine. If it will
then it's Erich Fruehstueck's. cheers, furunculus

Use a template. , wait. That's C
;-)

The problem with the void pointer thingy is that the function taking the
void pointer will not know what is being passed in. So you are stuck with a
whole bunch of callback functions.

If I understand what you want to do, that is.

No. 1# | By Developer Tags User at [2008-5-5] | size: 3265 bytes

Your Uncle said:

About a month ago, Heathfield posted the peudosource for random permuting
from TACP.

No, I didn't. I did, however, post some shuffling pseudocode and source,
just a few days ago, which was not taken from TACP.

It was all of maybe five lines. You needed to be able to do
two things: be able to get a random number in a range and swap.

Yes.

I
remembered that Dan Pop taught me to write the swap as a macro.

I find that surprising. I'd have thought Dan Pop would have more sense.

With
forum improvements, this became:
#define SWAP(m, n) (tmp = (m), (m) = (n), (n) = tmp)

That's fine as far as it goes, provided tmp exists and is of the appropriate
type.

The random number comes, again with forum improvements:
int rand_in_range(int m, int n)
{
/*seed srand in main */
/* [m, n] is range */
int roll_again_threshold, divisor, result, tmp, offset, num_results;

if (m>n) SWAP(m, n);
offset = m;
num_results = n - m + 1;

if (num_results == 1) {
return m;
}
--
roll_again_threshold = RAND_MAX - RAND_MAX%num_results;
divisor = ;

do {
result = rand();
} while (result >= roll_again_threshold);
result /= divisor;
return offset + result;
}

That's ghastly, but I can see what you're doing. Presumably this bit works
fine, so let's move on.

But then I starting thinking, and that is, of course, where the trouble
began. I posted elsewhere, and I don't think you need much of a language
background to get the gist of it:
Ich habe zwei Funktionen bei file scope erklaert:

"I explained two functions with file scope", according to Babelfish.

void permute_string(char * m, int n);
void permute_int(int * m, int n);
Sie tun das genau Gleiche, allerdings erstere mit chars und letztere mit
ints. Wie werden diese Funktionen Eine?

"They do that exactly resemble, however first with chars and the latters
with ints. How do these functions become one?"

Basically, how do I take 2 functions that differ only in the type they
operate on, and make them one? I was advised to use:
void permute (void *data, int n, size_t elsize);
that could be called for an array a with
permute(a, sizeof a / sizeof a[0], sizeof a[0]);
Is this going to work?

It can be made to work.

If it isn't, then the idea is mine. If it will
then it's Erich Fruehstueck's.

I doubt whether it's either your idea or Erich Fruehstueck's.

Incidentally, this isn't really permuting. It's shuffling.

Here is a generic swapping function:

void swap(void *s, void *t, size_t len)
{
unsigned char *u = s;
unsigned char *v = t;
unsigned char tmp;
while(len--)
{
tmp = *u;
*u++ = *v;
*v++ = tmp;
}
}

Here is a generic shuffling function:

void shuffle(void *s, size_t size, size_t len)
{
unsigned char *t = s;
unsigned char *u = s;
size_t i = 0;
size_t r = 0;
for(i = 0; i < len; i++)
{
r = (len - i) * rand() / (RAND_MAX + 1.0);
swap(t + size * i, u + size * r, size);
}
}

No. 1# | By Developer Tags User at [2008-5-5] | size: 3039 bytes


"Dann Corbit" <dcorbit@connx.comwrote in message
news:e7hucf$bkf$1@nntp.aioe.org
"Your Uncle" <invalid@crippled.netwrote in message
news:449c7966$0$31542$ec3e2dad@news.usenetmonster. com
>About a month ago, Heathfield posted the peudosource for random permuting
>from TACP. It was all of maybe five lines. You needed to be able to do
>two things: be able to get a random number in a range and swap. I
>remembered that Dan Pop taught me to write the swap as a macro. With
>forum improvements, this became:
>#define SWAP(m, n) (tmp = (m), (m) = (n), (n) = tmp)
>The random number comes, again with forum improvements:
>int rand_in_range(int m, int n)
>{
>/*seed srand in main */
>/* [m, n] is range */
>int roll_again_threshold, divisor, result, tmp, offset, num_results;
>>

>if (m>n) SWAP(m, n);
>offset = m;
>num_results = n - m + 1;
>>

>if (num_results == 1) {
>return m;
>}
>>
>>

>roll_again_threshold = RAND_MAX - RAND_MAX%num_results;
>divisor = ;
>>

>do {
>result = rand();
>} while (result >= roll_again_threshold);
>result /= divisor;
>return offset + result;
>}
>But then I starting thinking, and that is, of course, where the trouble
>began. I posted elsewhere, and I don't think you need much of a language
>background to get the gist of it:
>Ich habe zwei Funktionen bei file scope erklaert:
>void permute_string(char * m, int n);
>void permute_int(int * m, int n);
>Sie tun das genau Gleiche, allerdings erstere mit chars und letztere mit
>ints. Wie werden diese Funktionen Eine?
>Basically, how do I take 2 functions that differ only in the type they
>operate on, and make them one? I was advised to use:
>void permute (void *data, int n, size_t elsize);
>that could be called for an array a with
>permute(a, sizeof a / sizeof a[0], sizeof a[0]);
>Is this going to work? If it isn't, then the idea is mine. If it will
>then it's Erich Fruehstueck's. cheers, furunculus
>

Use a template. , wait. That's C
;-)
I'm on thin ice with topicality, so I better condemn this outrageous
suggestion.

The problem with the void pointer thingy is that the function taking the
void pointer will not know what is being passed in. So you are stuck with
a whole bunch of callback functions.
I'm not sure what that means. Maybe we could make a better trivial example:

void print_a_char(char);
void print_an_int(int);
would be definitions and then
print_a_char(char g){ printf(" %c\n", g) }
print_an_int(int g){ printf(" %d\n", g) }
Does that clarify, obfuscate, or just bore? cheers, f

No. 1# | By Developer Tags User at [2008-5-5] | size: 4540 bytes


"Richard Heathfield" <invalid@invalid.invalidwrote in message
news:hvWdnY1MJaB-HgHZRVnyhQ@bt.com
Your Uncle said:
>
>About a month ago, Heathfield posted the peudosource for random permuting
>from TACP.
>

No, I didn't. I did, however, post some shuffling pseudocode and source,
just a few days ago, which was not taken from TACP.
I'm experiencing a wonderful time-dilation while rehabbing an injury. Why
doesn't time drag when you're golfing?

>It was all of maybe five lines. You needed to be able to do
>two things: be able to get a random number in a range and swap.
>

Yes.
>
>I
>remembered that Dan Pop taught me to write the swap as a macro.
>

I find that surprising. I'd have thought Dan Pop would have more sense.
He does, but you have to remember he was talking to me.

>With
>forum improvements, this became:
>#define SWAP(m, n) (tmp = (m), (m) = (n), (n) = tmp)
>

That's fine as far as it goes, provided tmp exists and is of the
appropriate
type.
I'm surprised at how often this has caused me trouble.

>The random number comes, again with forum improvements:
>int rand_in_range(int m, int n)
>{
>/*seed srand in main */
>/* [m, n] is range */
>int roll_again_threshold, divisor, result, tmp, offset, num_results;
>>

>if (m>n) SWAP(m, n);
>offset = m;
>num_results = n - m + 1;
>>

>if (num_results == 1) {
>return m;
>}
>>
>>

>roll_again_threshold = RAND_MAX - RAND_MAX%num_results;
>divisor = ;
>>

>do {
>result = rand();
>} while (result >= roll_again_threshold);
>result /= divisor;
>return offset + result;
>}
>

That's ghastly, but I can see what you're doing. Presumably this bit works
fine, so let's move on.
>
>But then I starting thinking, and that is, of course, where the trouble
>began. I posted elsewhere, and I don't think you need much of a language
>background to get the gist of it:
>Ich habe zwei Funktionen bei file scope erklaert:
>

"I explained two functions with file scope", according to Babelfish.
>
>void permute_string(char * m, int n);
>void permute_int(int * m, int n);
>Sie tun das genau Gleiche, allerdings erstere mit chars und letztere mit
>ints. Wie werden diese Funktionen Eine?
>

"They do that exactly resemble, however first with chars and the latters
with ints. How do these functions become one?"
>
>Basically, how do I take 2 functions that differ only in the type they
>operate on, and make them one? I was advised to use:
>void permute (void *data, int n, size_t elsize);
>that could be called for an array a with
>permute(a, sizeof a / sizeof a[0], sizeof a[0]);
>Is this going to work?
>

It can be made to work.
If I fail, will a possible reason for this be that it was ill-advised to do
so as opposed to just having two awfully similar functions?


>If it isn't, then the idea is mine. If it will
>then it's Erich Fruehstueck's.
>

I doubt whether it's either your idea or Erich Fruehstueck's.

Incidentally, this isn't really permuting. It's shuffling.

Here is a generic swapping function:

void swap(void *s, void *t, size_t len)
{
unsigned char *u = s;
unsigned char *v = t;
unsigned char tmp;
while(len--)
{
tmp = *u;
*u++ = *v;
*v++ = tmp;
}
}
I'll just snipe this wholesale, thank you.

Here is a generic shuffling function:

void shuffle(void *s, size_t size, size_t len)
{
unsigned char *t = s;
unsigned char *u = s;
size_t i = 0;
size_t r = 0;
for(i = 0; i < len; i++)
{
r = (len - i) * rand() / (RAND_MAX + 1.0);
swap(t + size * i, u + size * r, size);
}
}
I'll need to take a closer look at this. Thanks and cheers, f

No. 1# | By Developer Tags User at [2008-5-5] | size: 998 bytes

Your Uncle wrote:
"Dann Corbit" <dcorbit@connx.comwrote in message
news:e7hucf$bkf$1@nntp.aioe.org
>
>>The problem with the void pointer thingy is that the function taking the
>>void pointer will not know what is being passed in. So you are stuck with
>>a whole bunch of callback functions.

>

I'm not sure what that means. Maybe we could make a better trivial example:

void print_a_char(char);
void print_an_int(int);
would be definitions and then
print_a_char(char g){ printf(" %c\n", g) }
print_an_int(int g){ printf(" %d\n", g) }
Does that clarify, obfuscate, or just bore? cheers, f

For a trivial example, the overhead would outweigh the benifit of a
generic function.

For a more complex example, you are stuck with the function not knowing
the type passed in and the compiler not being able to check whether the
passed types are supported.

No. 1# | By Developer Tags User at [2008-5-5] | size: 592 bytes

Your Uncle said:

"Richard Heathfield" <invalid@invalid.invalidwrote in message
news:hvWdnY1MJaB-HgHZRVnyhQ@bt.com
>Your Uncle said:
>>

Is this going to work?
>>

>It can be made to work.

If I fail, will a possible reason for this be that it was ill-advised to
do so as opposed to just having two awfully similar functions?

No. If you fail, it will be because you didn't manage to copy and paste the
code I gave you. :-)

No. 1# | By Developer Tags User at [2008-5-5] | size: 701 bytes

"Your Uncle" <invalid@crippled.netwrites:
[snip]

I've recently seen (or thought I saw) evidence that "Your Uncle",
"Frederick Gotham", and "Joe Smith" are the same person, posting under
different aliases. I recently asked you about this in the "wit's end"
thread, and you never answered.

Are "Your Uncle", "Frederick Gotham", and "Joe Smith" (or any two of
them) in fact the same person? If so, I ask you to pick a single
handle and stick with it. I don't care whether it's your real name or
not; pseudonyms are perfectly acceptable. But if you keep changing
identities, it makes the discussion more difficult to follow, with no
benefit.

No. 1# | By Developer Tags User at [2008-5-5] | size: 830 bytes

Your Uncle wrote:

"Richard Heathfield" <invalid@invalid.invalidwrote in message
news:hvWdnY1MJaB-HgHZRVnyhQ@bt.com
Your Uncle said:

>I
>remembered that Dan Pop taught me to write the swap as a macro.
>

I find that surprising.
I'd have thought Dan Pop would have more sense.
He does, but you have to remember he was talking to me.
>
>With
>forum improvements, this became:
>#define SWAP(m, n) (tmp = (m), (m) = (n), (n) = tmp)
>

That's fine as far as it goes, provided tmp exists and is of the
appropriate
type.
I'm surprised at how often this has caused me trouble.

This is what I use:

#define SWAP(A, B, T) \
((void)(*(T) = *(A), *(A) = *(B), *(B) = *(T)))

No. 1# | By Developer Tags User at [2008-5-5] | size: 923 bytes

Richard Heathfield schrieb:
Your Uncle said:
>>I
>>remembered that Dan Pop taught me to write the swap as a macro.

>

I find that surprising. I'd have thought Dan Pop would have more sense.

It is a matter of context:

somewhere around message 70 in the tree view; starting at
<2uf41aF26atlhU1@uni-berlin.demay suffice.
"Merrill & Michele" was the name the P went by back then.

Dan Pop IIRC mainly argued against my suggestions of how to
"fix" the macro and pointed out how they fell short -- in
the light of that, the original swap macro was a better
solution for him.
Disclaimer: It is easily possible that I misremember -- I
just tracked down the thread but did not read it.

<snip>
define SWAP(m, n) (tmp = (m), (m) = (n), (n) = tmp)
<snip>

Cheers
Michael

No. 1# | By Developer Tags User at [2008-5-5] | size: 2054 bytes


"Richard Heathfield"
Your Uncle said:
>"Richard Heathfield"

Your Uncle said:

Is this going to work?
It can be made to work.
>If I fail, will a possible reason for this be that it was ill-advised to
>do so as opposed to just having two awfully similar functions?

No. If you fail, it will be because you didn't manage to copy and paste
the
code I gave you. :-)
It doesn't do me a lick of good to snipe source, germane to what I know,
which I do not understand. You had a generic swap posted, and I frankly
can't quite remember what else, but in response to the what else, I wrote:
/* pruefer.c */
# include "big four.h"
#define MILL (.001)
int fu(int, int);
int main(void)
{# include <stdio.h>
unsigned long g, un_long_dummy, r = s = 0;
int m = 3, n = 17000, mean_less_one, t;
printf("taunt::continue: Y/N");
if (getchar == 'N') break;
mean_less_one = (n - m) / 2;
/* you wonder why Reiner einer
mistrusts syntax here until you reaun_long_dummyze
every time I read a unix jerk my
'\''s and '/''s switch */
/* control */
for (un_long_dummy = 0; un_long_dummy < g; ++ un_long_dummy)
{
t = fu(m, n);
if (t <= mean_less_one) ++ r;
else ++ s;
}
printf("r is %ul while s is %ul\n", r, s);
return 0;
}
int fu(int m, int n)
{
return n;
}
/* end .c begin .h */
/* bigfour.h */
# include <stdio.h>
# include <stdlib.h>
# include <math.h>
# include <time.h>
/* end bigfour.h */
Does this look like C? The question is meant to proceed along two lines:
q1) If I approach my compiler with this, will cl.exe give me
errors/warnings. q2) I conjecture that "bigfour.h" is not included in the c
standard. Given that the possibly non-standard header includes NLY
standard headers, what can a person say about it? cheers, furunculus

No. 1# | By Developer Tags User at [2008-5-5] | size: 632 bytes

/* pruefer.c */
# include "big four.h"
#define MILL (.001)
int fu(int, int);
int main(void)
{
unsigned long g, un_long_dummy, r = s = 0;
int m = 3, n = 17000, mean_less_one, t;
printf("taunt::continue: Y/N");
if (getchar == 'N') break;
mean_less_one = (n - m) / 2;

/* control */
for (un_long_dummy = 0; un_long_dummy < g; ++

un_long_dummy)
{
t = fu(m, n);
if (t <= mean_less_one) ++ r;
else ++ s;
}
printf("r is %ul while s is %ul\n", r, s);
return 0;
}
int fu(int m, int n)
{
return n;
}
/* repost pruefer.c */

No. 1# | By Developer Tags User at [2008-5-5] | size: 977 bytes

Keith Thompson posted:

I've recently seen (or thought I saw) evidence that "Your Uncle",
"Frederick Gotham", and "Joe Smith" are the same person, posting under
different aliases. I recently asked you about this in the "wit's end"
thread, and you never answered.

Are "Your Uncle", "Frederick Gotham", and "Joe Smith" (or any two of
them) in fact the same person? If so, I ask you to pick a single
handle and stick with it. I don't care whether it's your real name or
not; pseudonyms are perfectly acceptable. But if you keep changing
identities, it makes the discussion more difficult to follow, with no
benefit.

I only post to this newsgroup as "Frederick Gotham".

If you like my posts, then that's brilliant -- I enjoy posting here, and
it's a great hobby for me. If you don't like my posts, or if you suspect I
am posting under other aliases, I don't care to discuss the topic.

No. 1# | By Developer Tags User at [2008-5-5] | size: 1308 bytes


"Keith Thompson"
"Your Uncle"

I've recently seen (or thought I saw) evidence that "Your Uncle",
"Frederick Gotham", and "Joe Smith" are the same person, posting under
different aliases. I recently asked you about this in the "wit's end"
thread, and you never answered.

Are "Your Uncle", "Frederick Gotham", and "Joe Smith" (or any two of
them) in fact the same person? If so, I ask you to pick a single
handle and stick with it. I don't care whether it's your real name or
not; pseudonyms are perfectly acceptable. But if you keep changing
identities, it makes the discussion more difficult to follow, with no
benefit.
I think this topic could be reasonably addressed in the full-contact
arena: comp.std.c . I believe it addresses the normative underpinnings of
the C programming language. I know it affects the way this island is
perceived. Perception is important.
I am not a sufficiently strong voice to do much right now. It interrupts
my perception that I'm a guy on my back. I am not one lick sarcastic here.
Think of how much clc says "dont toppost" as opposed to "your source is
compost" .
Keith, my newsreaders have a lot more to say about my identity than do I.
gruss, furunculus

No. 1# | By Developer Tags User at [2008-5-5] | size: 286 bytes

Frederick Gotham wrote:
Keith Thompson posted:
Are "Your Uncle", "Frederick Gotham", and "Joe Smith" (or any two of
them) in fact the same person?
I only post to this newsgroup as "Frederick Gotham".
It was Frank Silvermann who's been sock puppeting.

No. 1# | By Developer Tags User at [2008-5-5] | size: 1560 bytes

"Your Uncle" <invalid@crippled.netwrites:
"Keith Thompson"
>I've recently seen (or thought I saw) evidence that "Your Uncle",
>"Frederick Gotham", and "Joe Smith" are the same person, posting under
>different aliases. I recently asked you about this in the "wit's end"
>thread, and you never answered.
>>

>Are "Your Uncle", "Frederick Gotham", and "Joe Smith" (or any two of
>them) in fact the same person? If so, I ask you to pick a single
>handle and stick with it. I don't care whether it's your real name or
>not; pseudonyms are perfectly acceptable. But if you keep changing
>identities, it makes the discussion more difficult to follow, with no
>benefit.

I think this topic could be reasonably addressed in the full-contact
arena: comp.std.c . I believe it addresses the normative underpinnings of
the C programming language. I know it affects the way this island is
perceived. Perception is important.
I am not a sufficiently strong voice to do much right now. It interrupts
my perception that I'm a guy on my back. I am not one lick sarcastic here.
Think of how much clc says "dont toppost" as opposed to "your source is
compost" .
Keith, my newsreaders have a lot more to say about my identity than do I.
gruss, furunculus

All right, then.

"Your Uncle"
"Frederick Gotham"
"Joe Smith"

A recommendation for the killfiles of those who use them.

No. 1# | By Developer Tags User at [2008-5-5] | size: 2019 bytes

In article <lnsllswvkw.fsf@nuthaus.mib.org>,
Keith Thompson <kst-u@mib.orgwrote:
>"Your Uncle" <invalid@crippled.netwrites:
>"Keith Thompson"

I've recently seen (or thought I saw) evidence that "Your Uncle",
"Frederick Gotham", and "Joe Smith" are the same person, posting under
different aliases. I recently asked you about this in the "wit's end"
thread, and you never answered.

Are "Your Uncle", "Frederick Gotham", and "Joe Smith" (or any two of
them) in fact the same person? If so, I ask you to pick a single
handle and stick with it. I don't care whether it's your real name or
not; pseudonyms are perfectly acceptable. But if you keep changing
identities, it makes the discussion more difficult to follow, with no
benefit.
>I think this topic could be reasonably addressed in the full-contact
>arena: comp.std.c . I believe it addresses the normative underpinnings of
>the C programming language. I know it affects the way this island is
>perceived. Perception is important.
>I am not a sufficiently strong voice to do much right now. It
>interrupts my perception that I'm a guy on my back. I am not one
>lick sarcastic here. Think of how much clc says "dont toppost" as
>opposed to "your source is compost" . Keith, my newsreaders have
>a lot more to say about my identity than do I. gruss, furunculus
>
>All right, then.
>
>"Your Uncle" "Frederick Gotham"


ITYM, Frank (Not Fred, he used to work for CBS) Silvermann

>"Joe Smith"
>
>A recommendation for the killfiles of those who use them.


You are a man on a mission from God, aren't you?

I have to ask, in all seriousness, what's the percentage/what's the
psychic benefit you get from slamming people you don't understand?

No. 1# | By Developer Tags User at [2008-5-5] | size: 178 bytes

Keith Thompson wrote:
"Your Uncle"
"Frederick Gotham"
ITYM "Frank Silvermann"
"Joe Smith"
A recommendation for the killfiles of those who use them.

No. 1# | By Developer Tags User at [2008-5-5] | size: 295 bytes

Kenny McCormack wrote:
I have to ask, in all seriousness, what's the percentage/what's the
psychic benefit you get from slamming people you don't understand?
Slamming people you don't understand,
is your entire purpose on this newsgroup,
isn't it?

No. 1# | By Developer Tags User at [2008-5-5] | size: 828 bytes

Keith Thompson posted:

All right, then.

"Your Uncle"
"Frederick Gotham"
"Joe Smith"

A recommendation for the killfiles of those who use them.

Hey hey hey what's all this about?!

I post under one name and one name only.

If you're THAT certain that I have an affiliation with the others you
have mentioned then PRVE IT, rather than sabotaging the enjoyable
experience a sincere poster has on this newsgroup.

I expect an apology from you once you have confirmed my innocence --
anything less would portray you as a malicious, inhospitable person.

You make a great contribution to the group, Keith, and I regularly find
your posts interesting -- but your elevated status on this group does not
warrant the malicious behaviour you have displayed.

No. 1# | By Developer Tags User at [2008-5-5] | size: 782 bytes

pete <pfiland@mindspring.comwrites:
Keith Thompson wrote:
>
>"Your Uncle"
>"Frederick Gotham"
>

ITYM "Frank Silvermann"

>
>"Joe Smith"
>>

>A recommendation for the killfiles of those who use them.


I think you're right. A quick look through the archives doesn't show
any indication that Frederick Gotham is the same person as "Joe Smith"
or "Your Uncle". I just confused the names somehow.

I apologize.

Since I appear to have messed this up, and I'm no longer sure who is
who, I withdraw my recommendation for people's killfiles. Everyone
should, as always, use his or her own judgement.

No. 1# | By Developer Tags User at [2008-5-5] | size: 580 bytes

Keith Thompson wrote:

pete <pfiland@mindspring.comwrites:
Keith Thompson wrote:

>"Frederick Gotham"
>

ITYM "Frank Silvermann"

I think you're right. A quick look through the archives doesn't show
any indication that Frederick Gotham is the same person as "Joe Smith"
or "Your Uncle". I just confused the names somehow.

Well you know, Frank starts with an Fr and ends with a k,
just like Frederick.
Silvermann ends with an a followed by two n's,
kind of looks like an m.

;)

No. 1# | By Developer Tags User at [2008-5-5] | size: 802 bytes



>>"Your Uncle" "Frederick Gotham"

>

ITYM, Frank (Not Fred, he used to work for CBS) Silvermann
>
>>"Joe Smith"

"large, jelly-filled donuts"
>>
>>A recommendation for the killfiles from God, aren't you?

>

I have to ask, in all seriousness, what's the percentage/what's the
psychic benefit you get from slamming people you don't understand?
I go out to the pub. I come back. Can someone explain to me what killfile
means in the context of the C programming language. By someone, I do not
mean a parochial American. getchar() f

No. 1# | By Developer Tags User at [2008-5-5] | size: 820 bytes


"Michael Mair" <Michael.Mair@invalid.invalidwrote in message
news:4g4hlpF1l865rU1@individual.net
Richard Heathfield schrieb:
>Your Uncle said:

I
remembered that Dan Pop taught me to write the swap as a macro.
>>

>I find that surprising. I'd have thought Dan Pop would have more sense.

Where's Dan ?

<witz>
solution for him.
Disclaimer: It is easily possible that I misremember -- I
just tracked down the thread but did not read it.
--
<snip>
define SWAP(m, n) (tmp = (m), (m) = (n), (n) = tmp)
<snip>
Wir sollten auf Deutsch. Ich bliebe lieber auf "Sie." Bitte informiere
mich wie ich Sie beleidigt habe? Kenneth Ford

No. 1# | By Developer Tags User at [2008-5-5] | size: 1392 bytes

Frederick Gotham said:

<snip>

I expect an apology from you once you have confirmed my innocence --
For the record, he has already done so (elsethread). He got you mixed up
with someone else.

anything less would portray you as a malicious, inhospitable person.

You make a great contribution to the group, Keith, and I regularly find
your posts interesting -- but your elevated status on this group does not
warrant the malicious behaviour you have displayed.

Keith hasn't displayed any malicious behaviour. He's just pointing out a
kook's multiple IDs for the benefit of anyone who hasn't spotted them yet,
and he accidentally caught your name up in the middle of it, for which, as
I say, he has already apologised.

If Keith has an "elevated status" on this group, it is because he is a
helpful, intelligent subscriber who is knowledgeable about the C language.
But he is not perfect. He makes mistakes, as we all do.

Twice to my knowledge, you have over-reacted to being corrected. This time,
you have over-reacted to a case of mistaken identity - with, it must be
said, rather more justification this time.

But in your own interests, you might want to consider dialing your
touchiness back to about 2 or 3. Right now, it's so high it's annoying the
neighbours.

No. 1# | By Developer Tags User at [2008-5-5] | size: 1757 bytes

Your Uncle said:

"Richard Heathfield"
>Your Uncle said:

"Richard Heathfield"
Your Uncle said:

Is this going to work?
It can be made to work.
If I fail, will a possible reason for this be that it was ill-advised to
do so as opposed to just having two awfully similar functions?
>No. If you fail, it will be because you didn't manage to copy and paste
>the
>code I gave you. :-)

It doesn't do me a lick of good to snipe source, germane to what I know,
which I do not understand.

Truly.

You had a generic swap posted

which, if you do not understand it, you should ask questions about.

and I frankly
can't quite remember what else, but in response to the what else, I wrote:
/* pruefer.c */
# include "big four.h"

<rather bizarre program snipped>

/* bigfour.h */
# include <stdio.h>
# include <stdlib.h>
# include <math.h>
# include <time.h>
/* end bigfour.h */
Does this look like C?

The program didn't. The header does (although I prefer not to mask standard
headers in that way, it is certainly legal to do it).

The question is meant to proceed along two lines:
q1) If I approach my compiler with this, will cl.exe give me
errors/warnings.

Yes.

q2) I conjecture that "bigfour.h" is not included in the c
standard.

You are correct.

Given that the possibly non-standard header includes NLY
standard headers, what can a person say about it?

That either the comment is not describing the filename accurately, or the
#include directive in your C file is wrong.

No. 1# | By Developer Tags User at [2008-5-5] | size: 1537 bytes

Sun, 25 Jun 2006 18:05:52 -0400, "Your Uncle"
<invalid@crippled.netwrote:

>/* pruefer.c */
># include "big four.h"
>#define MILL (.001)
>int fu(int, int);
>int main(void)
>{
>unsigned long g, un_long_dummy, r = s = 0;
>int m = 3, n = 17000, mean_less_one, t;
>printf("taunt::continue: Y/N");
>if (getchar == 'N') break;


getchar should be a function
so you here would compare the address of function getchar and (int)'N'

i advise you it is better to read and *follow* and resolve the
exercises on K&R2

this for me should be
int c;
label:;
printf("taunt::continue: Y/N ");
while((c=getchar())==' ');
if(c=='N' || c=='n' || c=='\n') return 0;
else if(c!='Y') goto label;
if(c!='\n') // for flush the line of input
while((c=getchar())!='\n');

i don't understand the remain but pc can understand better than me

>mean_less_one = (n - m) / 2;
>
>/* control */
>for (un_long_dummy = 0; un_long_dummy < g; ++un_long_dummy)
>{

t = fu(m, n);
if (t <= mean_less_one) ++ r;
else ++ s;
>}
>printf("r is %ul while s is %ul\n", r, s);
>return 0;
>}
>int fu(int m, int n)
>{

return n;
>}
>/* repost pruefer.c */

No. 1# | By Developer Tags User at [2008-5-5] | size: 1204 bytes

Frederick Gotham <fgothamN@SPAM.comwrites:
Keith Thompson posted:
>All right, then.
>>

>"Your Uncle"
>"Frederick Gotham"
>"Joe Smith"
>>

>A recommendation for the killfiles of those who use them.
>
>

Hey hey hey what's all this about?!

I post under one name and one name only.

If you're THAT certain that I have an affiliation with the others you
have mentioned then PRVE IT, rather than sabotaging the enjoyable
experience a sincere poster has on this newsgroup.

I expect an apology from you once you have confirmed my innocence --
anything less would portray you as a malicious, inhospitable person.

You make a great contribution to the group, Keith, and I regularly find
your posts interesting -- but your elevated status on this group does not
warrant the malicious behaviour you have displayed.

Frederick, please accept my apologies.

I had no malicious intent (and I'm not sure why you assumed that I
did). It was an honest mistake, and I'll be careful not to repeat it.

No. 1# | By Developer Tags User at [2008-5-5] | size: 1434 bytes

Keith Thompson posted:

Frederick Gotham <fgothamN@SPAM.comwrites:
>Keith Thompson posted:

All right, then.

"Your Uncle"
"Frederick Gotham"
"Joe Smith"

A recommendation for the killfiles of those who use them.
>>
>>

>Hey hey hey what's all this about?!
>>

>I post under one name and one name only.
>>

>If you're THAT certain that I have an affiliation with the others you
>have mentioned then PRVE IT, rather than sabotaging the enjoyable
>experience a sincere poster has on this newsgroup.
>>

>I expect an apology from you once you have confirmed my innocence --
>anything less would portray you as a malicious, inhospitable person.
>>

>You make a great contribution to the group, Keith, and I regularly
>find your posts interesting -- but your elevated status on this group
>does not warrant the malicious behaviour you have displayed.
>

Frederick, please accept my apologies.

I had no malicious intent (and I'm not sure why you assumed that I
did). It was an honest mistake, and I'll be careful not to repeat it.

Thank you.

Back to C!

No. 1# | By Developer Tags User at [2008-5-5] | size: 356 bytes

Frederick Gotham said:

Yes, I now accept that it was nothing more than an accident. However, in
life in general, I can't presume that everything ill-deed toward me is an
accident, which is why I presumed malice was involved rather than
accidental actions.

Never forget to shave with Hanlon's Razor! :-)

Ref: <>



C/C++ Hot!

C/C++ New!


Copyright © 2008 www.emsdn.com • All rights reserved • CMS Theme by www.emsdn.com - 0.422