473,394 Members | 1,893 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,394 software developers and data experts.

economizing with functions that do the same thing

About a month ago, Heathfield posted the peudosource for random permuting
from TAOCP. 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 = roll_again_threshold/num_results;

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

Jun 23 '06 #1
46 2392
"Your Uncle" <in*****@crippled.net> wrote in message
news:44***********************@news.usenetmonster. com...
About a month ago, Heathfield posted the peudosource for random permuting
from TAOCP. 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 = roll_again_threshold/num_results;

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. Oh, 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.
Jun 23 '06 #2
Your Uncle said:
About a month ago, Heathfield posted the peudosource for random permuting
from TAOCP.
No, I didn't. I did, however, post some shuffling pseudocode and source,
just a few days ago, which was not taken from TAOCP.
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 = roll_again_threshold/num_results;

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);
}
}

--
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 24 '06 #3

"Dann Corbit" <dc*****@connx.com> wrote in message
news:e7**********@nntp.aioe.org...
"Your Uncle" <in*****@crippled.net> wrote in message
news:44***********************@news.usenetmonster. com...
About a month ago, Heathfield posted the peudosource for random permuting
from TAOCP. 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 = roll_again_threshold/num_results;

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. Oh, 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
Jun 24 '06 #4
Your Uncle wrote:
"Dann Corbit" <dc*****@connx.com> wrote in message
news:e7**********@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.

--
Ian Collins.
Jun 24 '06 #5

"Richard Heathfield" <in*****@invalid.invalid> wrote in message
news:hv********************@bt.com...
Your Uncle said:
About a month ago, Heathfield posted the peudosource for random permuting
from TAOCP.
No, I didn't. I did, however, post some shuffling pseudocode and source,
just a few days ago, which was not taken from TAOCP.

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 = roll_again_threshold/num_results;

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
Jun 24 '06 #6
Your Uncle said:

"Richard Heathfield" <in*****@invalid.invalid> wrote in message
news:hv********************@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. :-)

--
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 24 '06 #7
"Your Uncle" <in*****@crippled.net> writes:
[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.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Jun 24 '06 #8
Your Uncle wrote:

"Richard Heathfield" <in*****@invalid.invalid> wrote in message
news:hv********************@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)))
--
pete
Jun 24 '06 #9
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:
http://groups.google.de/group/comp.l...c5271ccb9149a/
somewhere around message 70 in the tree view; starting at
<2u*************@uni-berlin.de> may suffice.
"Merrill & Michele" was the name the OP 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
--
E-Mail: Mine is an /at/ gmx /dot/ de address.
Jun 24 '06 #10

"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 ONLY
standard headers, what can a person say about it? cheers, furunculus
Jun 25 '06 #11
/* 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 */
Jun 25 '06 #12
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.
--

Frederick Gotham
Jun 25 '06 #13

"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
Jun 25 '06 #14
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.

http://groups.google.com/group/comp....295f3a382f1fbd

--
pete
Jun 26 '06 #15
"Your Uncle" <in*****@crippled.net> writes:
"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.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Jun 26 '06 #16
In article <ln************@nuthaus.mib.org>,
Keith Thompson <ks***@mib.org> wrote:
"Your Uncle" <in*****@crippled.net> writes:
"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?

Jun 26 '06 #17
Keith Thompson wrote:
"Your Uncle"
"Frederick Gotham"
ITYM "Frank Silvermann"
http://groups.google.com/group/comp....295f3a382f1fbd
"Joe Smith"

A recommendation for the killfiles of those who use them.


--
pete
Jun 26 '06 #18
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?

--
pete
Jun 26 '06 #19
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 PROVE 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 Gotham
Jun 26 '06 #20
pete <pf*****@mindspring.com> writes:
Keith Thompson wrote:
"Your Uncle"
"Frederick Gotham"


ITYM "Frank Silvermann"
http://groups.google.com/group/comp....295f3a382f1fbd
"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.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Jun 26 '06 #21
Keith Thompson wrote:

pete <pf*****@mindspring.com> writes:
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.

;)

--
pete
Jun 26 '06 #22

"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
Jun 26 '06 #23

"Michael Mair" <Mi**********@invalid.invalid> wrote in message
news:4g*************@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
Jun 26 '06 #24
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 ONLY
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.

--
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 26 '06 #25
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.

--
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 26 '06 #26
av
On Sun, 25 Jun 2006 18:05:52 -0400, "Your Uncle"
<in*****@crippled.net> wrote:
/* 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 */

Jun 26 '06 #27
Frederick Gotham <fg*******@SPAM.com> writes:
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 PROVE 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.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Jun 26 '06 #28
Keith Thompson posted:
Frederick Gotham <fg*******@SPAM.com> writes:
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 PROVE 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!
--

Frederick Gotham
Jun 26 '06 #29
Richard Heathfield posted:
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.

I had posted before he posted his subsequent post.

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.

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.

I had no intention of engaging in the conversation until I was
recommended for a kill file.

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.

Of course exactly. Calculate the precentage of posts here which are by
him, then take their quality into account, and you're left with a very
great contribution.
However perhaps you can appreciate my "inappreciation" at being
recommended for a kill file, when I all I aim to do here is engage in
interesting and enjoyable conversation pertaining to the C programming
language.

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.

Back to the C programming language.
--

Frederick Gotham
Jun 26 '06 #30
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: <http://www.catb.org/jargon/html/H/Hanlons-Razor.html>

--
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 26 '06 #31
Frederick Gotham <fg*******@SPAM.com> writes:
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.


You probably posted this before you saw my apology in the original
thread.

I welcome the opportunity to reiterate that I was mistaken in
including Frederick Gotham's name in the list.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Jun 26 '06 #32

"Richard Heathfield" <in*****@invalid.invalid> wrote in message
news:jp********************@bt.com...
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>

No, bizarre is when grown men speak of kill and file, without a handle on
either.
/* 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.

They will be such that I can deal with them.
q2) I conjecture that "bigfour.h" is not included in the c
standard.


You are correct.
Given that the possibly non-standard header includes ONLY
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.

Let me be more specific. A source text includes it's own header: fu.h whose
text is # include <stdio.h> . My question goes to c linkage. Indeed, when
linkage is the issue I think the terms c++ linkage or c linkage need a
terminology update. This question is to .c - c linkage. cheers, furunculus
Jun 27 '06 #33
[I *think* I got the attributions right]

Your Uncle wrote:
ITYM, Frank (Not Fred, he used to work for CBS) Silvermann
A recommendation for the killfiles from God, aren't you?

<snip>
I go out to the pub. I come back. Can someone explain to me what killfile
means
a killfile is a file used by some news reraders containing list of
people
whose posts you don't want to see. Hence to "killfile" someone is to
add
them to your killfile, because they are annoying or uninteresting or
whatever.

Posting under multiple aliases is irritating. Kenny is irritating.
[...]in the context of the C programming language.
it's to do with news groups rather than the C language
By someone, I do not mean a parochial American.
I find much of what you say quite incomprehensible. Are things like
this jokes?
getchar() f


??
--
Nick keighley

Jun 27 '06 #34
In article <11**********************@x69g2000cwx.googlegroups .com>,
Nick Keighley <ni******************@hotmail.com> wrote:
....
I find much of what you say quite incomprehensible. Are things like
this jokes?


Or maybe you're just stupid.

Jun 27 '06 #35
In article <44***********************@news.usenetmonster.com> ,
Your Uncle <in*****@crippled.net> wrote:
....
<rather bizarre program snipped>

No, bizarre is when grown men speak of kill and file, without a handle on
either.


What makes you think they are "grown".

From what I can tell, they are all just frustrated high school kids
(inside).

Jun 27 '06 #36
Kenny McCormack wrote:
In article <11**********************@x69g2000cwx.googlegroups .com>,
Nick Keighley <ni******************@hotmail.com> wrote:
...
I find much of what you say quite incomprehensible. Are things like
this jokes?


Or maybe you're just stupid.


(D. N. F. T. T.)

--
Chris Dollin
"Life is full of mysteries. Consider this one of them." Sinclair, /Babylon 5/

Jun 27 '06 #37
I appreciate your Einsatz and never forget a kindness. I've hit day's end
with my compiler:
/* Text1.c */
# include "Text2.h"
#define MILL (.001)
int fu(int, int);
int main(void)
{
unsigned long g = 15, un_long_dummy, r = 0, s = 0;
int m = 3, n = 17000, mean_less_one, t;
srand(time(NULL));
mean_less_one = (n - m) / 2;
printf("mu is %d\n" , mean_less_one);

for (un_long_dummy = 0; un_long_dummy < g; ++ un_long_dummy)
{
t = fu(m, n);
/* printf("tja"); */
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)
{
int t;
t = rand();
/* printf("tja"); */
return t;
}
/* end .c */
I don't see why r and s do not add to g here. I could talk about it but it
would only reveal the thickheadedness that motivates the question. I know
that there was some talk about unsigned longs and zero. I would certainly
hope that Mr. Ritchie had the foresight to include the additive identity of
the ring of integers in the datatype. So, I'm forced to believe that I'm
cross-eyed. gruss, furunculus
Jun 28 '06 #38

"Ian Collins" <ia******@hotmail.com> wrote in message
news:4g*************@individual.net...
Your Uncle wrote:
"Dann Corbit" <dc*****@connx.com> wrote in message
news:e7**********@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.

And that's what he meant with "callback functions?" I can't get my head
around it. cheers, f
Jun 28 '06 #39
Your Uncle wrote:
"Ian Collins" <ia******@hotmail.com> wrote in message
news:4g*************@individual.net...
Your Uncle wrote:
"Dann Corbit" <dc*****@connx.com> wrote in message
news:e7**********@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.


And that's what he meant with "callback functions?" I can't get my head
around it. cheers, f

Dan might have been referring to functions you would have to pass along
with the type to do whatever the action is.

For example in you print_a_something case, you would have to pass in the
something and a function to return the the appropriate format string.
If the something was more complex than a POD, a function to do the
printing would be required.

--
Ian Collins.
Jun 28 '06 #40

"Ian Collins" <ia******@hotmail.com> wrote in message
news:4g*************@individual.net...
Your Uncle wrote:
"Ian Collins" <ia******@hotmail.com> wrote in message
news:4g*************@individual.net...
Your Uncle wrote:

"Dann Corbit" <dc*****@connx.com> wrote in message
news:e7**********@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.


And that's what he meant with "callback functions?" I can't get my head
around it. cheers, f

Dan might have been referring to functions you would have to pass along
with the type to do whatever the action is.

For example in you print_a_something case, you would have to pass in the
something and a function to return the the appropriate format string.
If the something was more complex than a POD, a function to do the
printing would be required.

He's thinking down the hall. Since Keith Thompson shit all over my thread,
and no one wants to cross him, I think I'm looking for the exit sign. I use
aliases to protect both the innocent and not-so-very. This was a big issue
for me until I satisfied the statue in <limits.h> . My good friend Carl is
my attorney bernie, with whose friends I'm impressed. My brother is
Thunderfist, a former federal agent whose backyard is San Diego (diligence).
Since my c endeavors have ground to a halt at least for lack of comment and
a sore clickerfinger, I'll gear up for next month for when he comes to town
to lose a basketball game and query how to boost my projects. Black Ford
Jun 28 '06 #41
Your Uncle wrote:
"Ian Collins" <ia******@hotmail.com> wrote in message
news:4g*************@individual.net...
Dan might have been referring to functions you would have to pass along
with the type to do whatever the action is.

For example in you print_a_something case, you would have to pass in the
something and a function to return the the appropriate format string.
If the something was more complex than a POD, a function to do the
printing would be required.
He's thinking down the hall.


[drivel snipped]

What relevance did that drivel have to my response?

--
Ian Collins.
Jun 28 '06 #42
Ian Collins wrote:

Your Uncle wrote: [drivel snipped]

What relevance did that drivel have to my response?


I think the point that Frank was trying to make,
is that he's insane.

--
pete
Jun 28 '06 #43
"Your Uncle" <in*****@crippled.net> writes:
[...]
He's thinking down the hall. Since Keith Thompson shit all over my thread,
and no one wants to cross him, I think I'm looking for the exit sign. I use
aliases to protect both the innocent and not-so-very. This was a big issue
for me until I satisfied the statue in <limits.h> . My good friend Carl is
my attorney bernie, with whose friends I'm impressed. My brother is
Thunderfist, a former federal agent whose backyard is San Diego (diligence).
Since my c endeavors have ground to a halt at least for lack of comment and
a sore clickerfinger, I'll gear up for next month for when he comes to town
to lose a basketball game and query how to boost my projects. Black Ford


I'm responding to this only because you mentioned my name.

I have no clue what you're talking about. Fortunately, I don't care.

This is not your thread. The fact that you posted the original
article doesn't give you any kind of ownership. I don't know what you
think I did to this thread. If you'd care to explain without being
incoherent or offensive, I'll read what you have to say about it. (If
you're referring to the error I made in listing someone else's name as
one of your pseudonyms, I've already acknowledged that, and you
weren't the victim of my mistake anyway.)

I have no idea why you're telling us about your friend Carl or your
brother. We discuss the C programming language here. If you insist
on talking about whatever the hell you're talking about, I encourage
you to do it elsewhere. Nobody else cares.

I've already explained why your use of multiple pseudonyms is a
problem, and I have nothing to add to that.

The exit sign is easy to find. If you want to leave, all you have to
do is stop posting.

I doubt that I'll bother responding to you again.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Jun 28 '06 #44
Keith Thompson said:

<snip>
I doubt that I'll bother responding to you again.


I gave up on him some days ago.

--
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 #45
On Tue, 27 Jun 2006 23:30:05 -0400, "Your Uncle"
<in*****@crippled.net> wrote:
I appreciate your Einsatz and never forget a kindness. I've hit day's end
with my compiler:
/* Text1.c */
# include "Text2.h"
#define MILL (.001)
int fu(int, int);
int main(void)
{
unsigned long g = 15, un_long_dummy, r = 0, s = 0;
int m = 3, n = 17000, mean_less_one, t;
srand(time(NULL));
mean_less_one = (n - m) / 2;
printf("mu is %d\n" , mean_less_one);

for (un_long_dummy = 0; un_long_dummy < g; ++ un_long_dummy)
{
t = fu(m, n);
/* printf("tja"); */
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)
{
int t;
t = rand();
/* printf("tja"); */
return t;
}
/* end .c */
I don't see why r and s do not add to g here. I could talk about it but it
would only reveal the thickheadedness that motivates the question. I know
that there was some talk about unsigned longs and zero. I would certainly
hope that Mr. Ritchie had the foresight to include the additive identity of
the ring of integers in the datatype. So, I'm forced to believe that I'm
cross-eyed. gruss, furunculus


What do you think %ul means? What is the correct format conversion
for unsigned long? This probably wouldn't have confused you if ell
didn't look so much like one.
Remove del for email
Jun 29 '06 #46
Richard Heathfield wrote:
Keith Thompson said:

<snip>
I doubt that I'll bother responding to you again.


I gave up on him some days ago.


I've come to that conclusion as well, all his various personalities are
heading for the bozo bin.


Brian
Jun 29 '06 #47

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

Similar topics

5
by: hokiegal99 | last post by:
A few questions about the following code. How would I "wrap" this in a function, and do I need to? Also, how can I make the code smart enough to realize that when a file has 2 or more bad...
99
by: David MacQuigg | last post by:
I'm not getting any feedback on the most important benefit in my proposed "Ideas for Python 3" thread - the unification of methods and functions. Perhaps it was buried among too many other less...
7
by: Nolan Martin | last post by:
is a static functions address constant? ie.. static void func(); write_to_file(&func); Restart program... static void func(); void (*funcPtr) ();
9
by: Gibby Koldenhof | last post by:
Hiya, Terrible subject but I haven't got a better term at the moment. I've been building up my own library of functionality (all nice conforming ISO C) for over 6 years and decided to adopt a...
6
by: junky_fellow | last post by:
what are reentrant functions? What are the characteristics of a reentrant code ? what things should be kept in mind while writing a reentrant code ?
44
by: bahadir.balban | last post by:
Hi, What's the best way to implement an overloaded function in C? For instance if you want to have generic print function for various structures, my implementation would be with a case...
23
by: Timothy Madden | last post by:
Hello all. I program C++ since a lot of time now and I still don't know this simple thing: what's the problem with local functions so they are not part of C++ ? There surely are many people...
13
by: Richard G. Riley | last post by:
In another thread it was pointed out that I'd made a booboo with strcpy : one that that I've, if I'm honest, made many times before. Not out of badness, just because since I first programmed C...
8
by: Edward Diener | last post by:
By reuse, I mean a function in an assembly which is called in another assembly. By a mixed-mode function I mean a function whose signature has one or more CLR types and one or more non-CLR...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.