473,473 Members | 2,144 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Why the first 4 character set with 0?

I'm writing a casting function like that,
string dbl2s(double dbl)
{
char chs[MAX_STRING_LENGTH];
memset(chs, 0, sizeof(chs));
_snprintf_s(chs, _countof(chs), MAX_STRING_LENGTH, "%f", dbl);
return string (chs);
}

------------------------------------------------------------------

I find that each time when the double value converts to the char
array. The first 4 char will be set to 0, but from the 5th one will
be the right value. So in the end the string will be treated as a null
string. I use std::string.

Does anybody know why? I really appreciate for your help.
Jul 27 '08 #1
26 1394
cutecutemouse wrote:
I'm writing a casting function like that,
string dbl2s(double dbl)
{
char chs[MAX_STRING_LENGTH];
I would strongly recommend initialising it:

char chs[MAX_STRING_LENGTH] = {};

then you don't need the following statement.
memset(chs, 0, sizeof(chs));
_snprintf_s(chs, _countof(chs), MAX_STRING_LENGTH, "%f", dbl);
What does that function do? What are the meanings of the second and the
third argument? You're supplying the same value, no?
return string (chs);
}

------------------------------------------------------------------

I find that each time when the double value converts to the char
array. The first 4 char will be set to 0, but from the 5th one will
be the right value. So in the end the string will be treated as a null
string. I use std::string.

Does anybody know why? I really appreciate for your help.
Since '_snprintf_s' is not a standard function, you should either
explain what it's supposed to do, or post to the newsgroup where it is
on topic.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Jul 27 '08 #2
I want to convert a double value to a string. And I read about this
function from an article. I just want to know why this problem
happened.
On 27 Jul., 16:32, Victor Bazarov <v.Abaza...@comAcast.netwrote:
cutecutemouse wrote:
I'm writing a casting function like that,
string dbl2s(double dbl)
{
char chs[MAX_STRING_LENGTH];

I would strongly recommend initialising it:

char chs[MAX_STRING_LENGTH] = {};

then you don't need the following statement.
memset(chs, 0, sizeof(chs));
_snprintf_s(chs, _countof(chs), MAX_STRING_LENGTH, "%f", dbl);

What does that function do? What are the meanings of the second and the
third argument? You're supplying the same value, no?
return string (chs);
}
------------------------------------------------------------------
I find that each time when the double value converts to the char
array. The first 4 char will be set to 0, but from the 5th one will
be the right value. So in the end the string will be treated as a null
string. I use std::string.
Does anybody know why? I really appreciate for your help.

Since '_snprintf_s' is not a standard function, you should either
explain what it's supposed to do, or post to the newsgroup where it is
on topic.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Jul 27 '08 #3

"cutecutemouse" <pl******@hotmail.comwrote in message
news:f8**********************************@m45g2000 hsb.googlegroups.com...
On 27 Jul., 16:32, Victor Bazarov <v.Abaza...@comAcast.netwrote:
>cutecutemouse wrote:
I'm writing a casting function like that,
string dbl2s(double dbl)
{
char chs[MAX_STRING_LENGTH];

I would strongly recommend initialising it:

char chs[MAX_STRING_LENGTH] = {};

then you don't need the following statement.
memset(chs, 0, sizeof(chs));
_snprintf_s(chs, _countof(chs), MAX_STRING_LENGTH, "%f", dbl);

What does that function do? What are the meanings of the second and the
third argument? You're supplying the same value, no?
return string (chs);
}
------------------------------------------------------------------
I find that each time when the double value converts to the char
array. The first 4 char will be set to 0, but from the 5th one will
be the right value. So in the end the string will be treated as a null
string. I use std::string.
Does anybody know why? I really appreciate for your help.

Since '_snprintf_s' is not a standard function, you should either
explain what it's supposed to do, or post to the newsgroup where it is
on topic.
>I want to convert a double value to a string. And I read about this
function from an article. I just want to know why this problem
happened.
Please don't top-post, message rearranged.

I googled for _snprintf_s and found out it's Microsoft's bastardisation of
sprintf, and, yes, it seems the 2nd and 3rd parameters in this case should
be the same. Using the standard version would give us:

sprintf( chs, "%f", dbl );

which looks fine to me. To be hontest, I don't know what the problem is,
not sure if it's a Microsoft problem, something else, etc.. but afaic it
doesn't matter because _snprintf_s should never be used anyway, just use
stringstream.

std::stringstream convert;
convert << dbl;
std::string value;
convert >value;

This kind of thing is done so much, in fact, that there are templates for
it. This is the one I use:

template<typename T, typename F T StrmConvert( const F from )
{
std::stringstream temp;
temp << from;
T to = T();
temp >to;
return to;
}

template<typename Fstd::string StrmConvert( const F from )
{
return StrmConvert<std::string>( from );
}

If you use boost they have a lexical cast that's about the same thing.
Anyway, it's rather simple.

double Foo = 1234.56;
std:::string Bar = StrmConvert( Foo );
Jul 27 '08 #4
cutecutemouse <pl******@hotmail.comwrote:
I'm writing a casting function like that,
string dbl2s(double dbl)
{
char chs[MAX_STRING_LENGTH];
memset(chs, 0, sizeof(chs));
_snprintf_s(chs, _countof(chs), MAX_STRING_LENGTH, "%f", dbl);
return string (chs);
}

------------------------------------------------------------------

I find that each time when the double value converts to the char
array. The first 4 char will be set to 0, but from the 5th one will
be the right value. So in the end the string will be treated as a null
string. I use std::string.

Does anybody know why? I really appreciate for your help.
I don't know the answer, but as others have suggested, use a
stringstream.

Here's what I use:

template < typename T, typename U >
T lexical_cast( const U& u ) {
std::stringstream ss;
T t;
if ( !( ss << u && ss >t ) ) throw std::bad_cast();
return t;
}
void foo( double dbl ) {
string str = lexical_cast<string>( dbl );
// now use str.
}
Jul 27 '08 #5
Thank you for all the replies. I've just tried two ways. To use
stringstream, like the template what Jim said, and another way with
sprintf_s. But the problem is the same. The first 4 character are
always set to some strange chars. I'm really confused with it...
Jul 27 '08 #6
cutecutemouse <pl******@hotmail.comwrote:
Thank you for all the replies. I've just tried two ways. To use
stringstream, like the template what Jim said, and another way with
sprintf_s. But the problem is the same. The first 4 character are
always set to some strange chars. I'm really confused with it...
Show us the stringstream code that exhibits the problem you are having.
Jul 27 '08 #7
Sam
cutecutemouse writes:
Thank you for all the replies. I've just tried two ways. To use
stringstream, like the template what Jim said, and another way with
sprintf_s. But the problem is the same. The first 4 character are
always set to some strange chars. I'm really confused with it...
Go ask Microsoft. You were told, repeatedly, that this is not a standard C++
function, but some Microsoft-specific rogue mutation. Only Microsoft can
tell you what it does or how it works.

This newsgroup is not for discussions of Microsoft-specific language
variations, but rather the standard C++ language.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEABECAAYFAkiMv8QACgkQx9p3GYHlUOKaXQCePfIbpWg982 IXlcGy3KHGc45A
IYkAn1AY2duM+wQMmrRnuOq5iA4QZR6Z
=CnfR
-----END PGP SIGNATURE-----

Jul 27 '08 #8
"Sam" <sa*@email-scan.comwrote in message
news:co******************************@commodore.em ail-scan.com...
[???]

Sam,

It's not the first time I saw a posting from you that does not
seem to have any content. It turns out you use some kind of
format that causes your reply to appear as an attachment (which
in a text-only newsgroup is prohibited, and many actually have
those disabled). Could you perhaps set your newsreader so that
no attachment is made out of your reply and instead plain text
is used, please? It would make the lives of many of us easier.
That is, if you care whether anybody actually reads what you
post...

Thanks!

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Jul 27 '08 #9
Sam
Victor Bazarov writes:
Sam,

It's not the first time I saw a posting from you that does not
seem to have any content. It turns out you use some kind of
format that causes your reply to appear as an attachment (which
Only in broken newsreaders.
in a text-only newsgroup is prohibited, and many actually have
those disabled). Could you perhaps set your newsreader so that
no attachment is made out of your reply
All my messages are always posted in plain text, and not an attachment:

Content-Type: text/plain; format=flowed; charset="US-ASCII"
Content-Disposition: inline
Content-Transfer-Encoding: 7bit
and instead plain text
is used, please?
Please stop blaming me for known ten-year old bugs in Microsoft's crapware.
Microsoft's crapware can't wrap its brain around digitally-signed messages,
that all modern newsreaders, such as Mozilla Thunderbird, have no problems
displaying, so it pukes and shows it as an attachment.
It would make the lives of many of us easier.
That is, if you care whether anybody actually reads what you
post...
Go tell Microsoft to fix their broken newsreader, and implement RFC 2015,
the standard for digitally-signed messages that's been published in 1996.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEABECAAYFAkiM2K4ACgkQx9p3GYHlUOIF0ACeMvd3oiGfr8 Z6R73QB0V9iG3B
LIAAnA6/BQNuMxTG2fgljAuckgj2khPp
=oNGh
-----END PGP SIGNATURE-----

Jul 27 '08 #10
On Jul 27, 10:21 pm, Sam <s...@email-scan.comwrote:
Victor Bazarov writes:
Sam,
It's not the first time I saw a posting from you that does not
seem to have any content. It turns out you use some kind of
format that causes your reply to appear as an attachment (which
Only in broken newsreaders.
For your personal definition of broken.
in a text-only newsgroup is prohibited, and many actually have
those disabled). Could you perhaps set your newsreader so that
no attachment is made out of your reply
All my messages are always posted in plain text, and not an
attachment:
The one Victor was replying to wasn't. Google groups may have a
number of problems, but it does allow displaying the actual
message sent, and your response was in a mime attachment.
Content-Type: text/plain; format=flowed; charset="US-ASCII"
Content-Disposition: inline
Content-Transfer-Encoding: 7bit
In the mime header. The basic policy for newsgroups which don't
specify otherwise is that mime is not allowed.
and instead plain text
is used, please?
Please stop blaming me for known ten-year old bugs in
Microsoft's crapware. Microsoft's crapware can't wrap its
brain around digitally-signed messages, that all modern
newsreaders, such as Mozilla Thunderbird, have no problems
displaying, so it pukes and shows it as an attachment.
You might try to find out what you're really sending, first.
It would make the lives of many of us easier.
That is, if you care whether anybody actually reads what you
post...
Go tell Microsoft to fix their broken newsreader, and
implement RFC 2015, the standard for digitally-signed messages
that's been published in 1996.
That standard involves Mime, and the standard for this (and most
groups) is that Mime isn't allowed.

--
James Kanze (GABI Software) email:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
Jul 27 '08 #11
In article <co******************************@commodore.emai l-scan.com>,
Sam <sa*@email-scan.comwrote:
Victor Bazarov writes:
Sam,

It's not the first time I saw a posting from you that does not
seem to have any content. It turns out you use some kind of
format that causes your reply to appear as an attachment (which

Only in broken newsreaders.
in a text-only newsgroup is prohibited, and many actually have
those disabled). Could you perhaps set your newsreader so that
no attachment is made out of your reply

All my messages are always posted in plain text, and not an attachment:

Content-Type: text/plain; format=flowed; charset="US-ASCII"
Content-Disposition: inline
Content-Transfer-Encoding: 7bit
and instead plain text
is used, please?

Please stop blaming me for known ten-year old bugs in Microsoft's crapware.
Microsoft's crapware can't wrap its brain around digitally-signed messages,
that all modern newsreaders, such as Mozilla Thunderbird, have no problems
displaying, so it pukes and shows it as an attachment.
I have the same issue, and I'm not using anything Microsoft. But
apparently this GnuPG crap is more important than the message content
being readable easily by everyone, so I'll just use my newsreader's
filtering. And no, I can't get an update, because I'm using an old
computer with an old OS. Everyone else's messages appear fine.
Jul 28 '08 #12
"cutecutemouse" <pl******@hotmail.comwrote in message
news:9b**********************************@y38g2000 hsy.googlegroups.com...
Thank you for all the replies. I've just tried two ways. To use
stringstream, like the template what Jim said, and another way with
sprintf_s. But the problem is the same. The first 4 character are
always set to some strange chars. I'm really confused with it...
Okay, please give us a very small short program that displays the behavior
you are experiencing. It is possible you have something mistanken or
something, we can't tell because we don't know what you are doing. Please
show some compilable code that shows your problem.

Regards,

Jim Langston
Jul 28 '08 #13
On 27 Jul, 15:16, cutecutemouse <plhal...@hotmail.comwrote:
I'm writing a casting function like that,

string dbl2s(double dbl)
{
* * * * char chs[MAX_STRING_LENGTH];
* * * * memset(chs, 0, sizeof(chs));
* * * * _snprintf_s(chs, _countof(chs), MAX_STRING_LENGTH, "%f", dbl);
* * * * return string (chs);

}

------------------------------------------------------------------

I find that each time when the double value converts to the char
array. The first 4 char will be set to 0, but from the 5th *one will
be the right value. So in the end the string will be treated as a null
string. I use std::string.

Does anybody know why? I really appreciate for your help.
I don't have the problem with sprintf(). This is my code:

// cute.cpp

#include <cstdlib>
#include <cstdio>
#include <string>

using namespace std;

#define MAX_STRING_LENGTH 32

string dbl2s(double dbl)
{
char chs[MAX_STRING_LENGTH];

memset (chs, 0, sizeof(chs));
sprintf (chs, "%f", dbl);

return string (chs);
}

int main (void)
{
double d = 2.182;
string s = dbl2s (d);
const char* cstr = s.c_str();

for (int i = 0; i < s.size(); i++)
printf ("%02x ", cstr[i] & 0xff);

printf ("\n%s\n", cstr);

return 0;
}

its output is:

C:\bin\Debug>cute.exe
32 2e 31 38 32 30 30 30
2.182000

there are no leading zeros
--
Nick Keighley

Jul 28 '08 #14
I really appreciate all your help. Now I found the way to solve the
problem by just switching the Release mode to Debug mode. I think that
could be some library conflict because I'm using AutoCAD ObjectARX
interface.
I'm just a newbie here and sometimes do not know well with the rules.
If I did something wrong, I beg your pardon this time.
Jul 28 '08 #15
cutecutemouse wrote:
I really appreciate all your help. Now I found the way to solve the
problem by just switching the Release mode to Debug mode. I think that
could be some library conflict because I'm using AutoCAD ObjectARX
interface.
That didn't "solve" anything. One common feature of debug modes is to
zero out automatic memory. Probably you have masked the error, rather
than solving it.


Brian
Jul 28 '08 #16
In article <81**********************************@p25g2000hsf. googlegroups.com>,
cutecutemouse <pl******@hotmail.comwrote:
>I really appreciate all your help. Now I found the way to solve the
problem by just switching the Release mode to Debug mode. I think that
could be some library conflict because I'm using AutoCAD ObjectARX
interface.
I'm just a newbie here and sometimes do not know well with the rules.
If I did something wrong, I beg your pardon this time.
That you "solved the problem" that way is a good thing.
However, not in the way you think. This is a syndrome I
call `good garbage'. In effect what you've done is to
change the state of your program so that it appears correct,
by virtue of alledgedly producing the correct output.
It's a tough one. Because often running your program in
a debugger can make this syndrome come about. So can just
putting in printf statements etc. But of course, the problem
IS still there. I'm jumping in mid-thread here, so dunno what
been discussed or not previously in the thread, but putting
it into debug mode is not a solution, and eventually it will
probably come to bite you, and it will do so exactly at a time
when you most need it not to. So I would suggest you backpeddle
somewhat and try to tap into more about your program, your tools, etc.
I hear that you're a newbie (at least here) so I'm not trying
to say any of this lightly, since I realize lots about programming
etc is probably like figuring out how to get into a locked door.
But keep at it, and slowly and surely some of the mystery should
vaporize into some "aha!" moments. In the meantime, plan some
strategy to see why your release mode is running into problems.
You mention something about a library conflict, sure, they can sometimes
wreak havoc as much as anything else. So try to delve deeper into
why that would cause your problem, as well as how to solve, as well
as realizing that the lib may have nothing to do with it at all.
And most of all enjoy!
--
Greg Comeau / 4.3.10.1 with C++0xisms now in beta!
Comeau C/C++ ONLINE == http://www.comeaucomputing.com/tryitout
World Class Compilers: Breathtaking C++, Amazing C99, Fabulous C90.
Comeau C/C++ with Dinkumware's Libraries... Have you tried it?
Jul 28 '08 #17
In article <g6**********@panix1.panix.com>,
Greg Comeau <co****@comeaucomputing.comwrote:
>In article <81**********************************@p25g2000hsf. googlegroups.com>,
cutecutemouse <pl******@hotmail.comwrote:
>>I really appreciate all your help. Now I found the way to solve the
problem by just switching the Release mode to Debug mode. I think that
could be some library conflict because I'm using AutoCAD ObjectARX
interface.
I'm just a newbie here and sometimes do not know well with the rules.
If I did something wrong, I beg your pardon this time.

That you "solved the problem" that way is a good thing.
However, not in the way you think. This is a syndrome I
call `good garbage'. In effect what you've done is to
change the state of your program so that it appears correct,
by virtue of alledgedly producing the correct output.
It's a tough one. Because often running your program in
a debugger can make this syndrome come about. So can just
putting in printf statements etc. But of course, the problem
IS still there. I'm jumping in mid-thread here, so dunno what
been discussed or not previously in the thread, but putting
it into debug mode is not a solution, and eventually it will
probably come to bite you, and it will do so exactly at a time
when you most need it not to. So I would suggest you backpeddle
somewhat and try to tap into more about your program, your tools, etc.
I hear that you're a newbie (at least here) so I'm not trying
to say any of this lightly, since I realize lots about programming
etc is probably like figuring out how to get into a locked door.
But keep at it, and slowly and surely some of the mystery should
vaporize into some "aha!" moments. In the meantime, plan some
strategy to see why your release mode is running into problems.
You mention something about a library conflict, sure, they can sometimes
wreak havoc as much as anything else. So try to delve deeper into
why that would cause your problem, as well as how to solve, as well
as realizing that the lib may have nothing to do with it at all.
And most of all enjoy!
BTW, the reason I said it appearing to work in debug mode was
a good thing was not because I find that acceptable, but because
it gives you a point of consistency to work with. Getting past
that is not easy, because it is often a clueless situation,
or at least appears so. Here's some initial food for thought,
not necessarily asked to be answered here:
Soes it work because you got lucky?
Does it work because perhaps something is uninitialized and is
now being initialized (either purposely or "accidently")?
What is different about the debug mode?
Keep the questions going...
--
Greg Comeau / 4.3.10.1 with C++0xisms now in beta!
Comeau C/C++ ONLINE == http://www.comeaucomputing.com/tryitout
World Class Compilers: Breathtaking C++, Amazing C99, Fabulous C90.
Comeau C/C++ with Dinkumware's Libraries... Have you tried it?
Jul 28 '08 #18
Sam wrote:
James Kanze writes:
>On Jul 28, 1:03 am, Sam <s...@email-scan.comwrote:
>>James Kanze writes:
On Jul 27, 10:21 pm, Sam <s...@email-scan.comwrote:
Victor Bazarov writes:
Sam,
<sniped mime noise>
> RFC 2046 applies to a specific
use of Mime,

2046 is anything but specific. It coveres a wide swath of MIME formatting.
> and Mime isn't considered acceptable in the big
eight, except when the charter of the newsgroup explicitely says
otherwise.

Then /you/ should stop posting using MIME formatting, according to your own
assertions.

Of course, that's bunk. MIME posting are always acceptable, and have been
that way for a long time.
Wrong, very wrong.
>Go learn a little about how news groups work, and get back to
us.

Go check what millenium we're in, and if you prefer to go back to the
pre-MIME days, I'll help you find a TARDIS.
I'm not at all alone in that my fiters simply send all inappropriate
mime to the bit bucket. I only saw this thread because of others. You
would probably be surprised at the number of people simply won't even
see anything posted by people who are either ignorant of usenet or
simply refuse to act civilized.

<snip>
Wake up and smell the millenium.
Actually I can smell the rudeness of todays youth. Apparently thats the
smell your generation chooses willingly. Sad.

<snip>
>you have even the slightest notion of how news works?

I'm fairly certain that I do.
You would again be wrong. It's not really that hard to read up. If
you're interested there are many resources available.
Until you learn what MIME is and isn't, you're the one who's better advised
not to comment on subjects you know very little about.
You really don't appear to know all that much about mime or usenet.
Again if you want information, it's available. On the other hand if you
simply want to rant on about how you want usenet to work I'm afraid
you'll soon be like the tree falling in the forest with no humans around
to hear.

Just a thought. If you are interested in c++, there is a lot of
knowledge, experience, and talent around here and its hard not to learn
something if you hang around. But if you end up plonked you wont be
participating often. This group is fairly high volume as it is and it
doesn't take all that much to demonstrate that you have no intention of
acting civilized and consequently simply aren't worth the effort to wade
through the noise. Again, just a thought.
Jul 30 '08 #19
Sam
stan writes:
Sam wrote:
>>
Then /you/ should stop posting using MIME formatting, according to your own
assertions.

Of course, that's bunk. MIME posting are always acceptable, and have been
that way for a long time.
Wrong, very wrong.
And your claimed to fame, MIME-wise, is…?
>>Go learn a little about how news groups work, and get back to
us.

Go check what millenium we're in, and if you prefer to go back to the
pre-MIME days, I'll help you find a TARDIS.
I'm not at all alone in that my fiters simply send all inappropriate
mime to the bit bucket.
Then you must be dumping ~90% messages in this newsgroup that are
MIME-formatted.
I only saw this thread because of others. You
would probably be surprised at the number of people simply won't even
see anything posted by people who are either ignorant of usenet or
simply refuse to act civilized.
I'm never surprised by astonishing levels of ignorance, but willingness to
speak with authority on subjects that one does not really know much about..
>>you have even the slightest notion of how news works?

I'm fairly certain that I do.
You would again be wrong. It's not really that hard to read up. If
you're interested there are many resources available.
Gee, then how did I manage to write an NNTP client without doing all that?
Must've been a lucky guess.
>Until you learn what MIME is and isn't, you're the one who's better advised
not to comment on subjects you know very little about.
You really don't appear to know all that much about mime or usenet.
And what exactly do you, yourself, know, that makes you such an expert on
this subject?
Just a thought. If you are interested in c++, there is a lot of
knowledge, experience, and talent around here and its hard not to learn
something if you hang around. But if you end up plonked you wont be
participating often.
You are operating under a rather major misconception. You obviously live in
perpetual fear of getting "plonked", given that admonishment of yours. Well,
see, not everyone shares your insecurities.
This group is fairly high volume as it is and it
doesn't take all that much to demonstrate that you have no intention of
acting civilized and consequently simply aren't worth the effort to wade
through the noise. Again, just a thought.
I encourage you to keep having these kinds of thoughts. It's a good mental
excersize.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEABECAAYFAkiP16UACgkQx9p3GYHlUOL5qwCfYGVQL1tH+s J175Aqv5HEAHfE
2pQAoIDyd0FPjdbNdVlydrjVDrRBz4pg
=Eezk
-----END PGP SIGNATURE-----

Jul 30 '08 #20
On Tue, 29 Jul 2008 21:53:25 -0500, Sam wrote:

[...]
You are operating under a rather major misconception. You obviously live
in perpetual fear of getting "plonked", given that admonishment of
yours. Well, see, not everyone shares your insecurities.
<plonk:)
Attachment not shown: MIME type application/pgp-signature
Duh!

--
Lionel B
Jul 30 '08 #21
On Jul 29, 1:16 pm, Sam <s...@email-scan.comwrote:
James Kanze writes:
On Jul 28, 1:10 pm, Sam <s...@email-scan.comwrote:
James Kanze writes:
Exactly. And since the standard policy in newsgroups in the big
eight is not to allow MIME, it doesn't apply here.
There is no such policy.
There always has been.

There's also a policy of lurking a month before posting, to see
what is acceptable and what isn't. Had you done that, you'd see
that no one else uses Mime attachments, because they aren't
considered acceptable. But of course, since you're the only one
who counts in your world, you can't be bothered by a thing like
that.
I don't post in MIME.
Yes, you do. Every one of your messages is MIME formatted.
Obviously, you don't know what MIME is (and haven't even read
the RFC which you signaled).

Anyway, I'm not going to waste my time arguing with you. Anyone
can read the relevant RFC's if they want.
Now look at the original whiner's complaint. That's not
exactly what he claimed.
Yes it is.
No, it's not.
The original complaint was that he didn't automatically see your
response. Which is due to the fact that your response is in a
Mime attachment, and his newsreader doesn't automatically open
Mime attachments.

Note that your postings are the only ones which cause this
problem. So either you're wrong, or every one else here is
wrong.
He is also moderator of rec.humor.funny, in the
big eight. Where the rules
(http://www.netfunny.com/rhf/submit.html) are:
- Plain text E-mail only, thanks. Not HTML, Not multipart
It's a moderated newsgroup. Moderated newsgroups may set their
own rules.
All groups set their own rules. In the case of this group, the
group was founded before the current rules for group creation
went into effect, so it gets the default set of rules.

If you want a C++ group in which Mime attachments are allowed,
you're free to create one. There are standard procedured for
it.
The millenium has nothing to do with it. Various newsgroups
establish the rules for that newsgroup, by consensus. And the
consensus in the big eight is that by default, MIME is not
allowed.
There is no such concensus. I recall reading someone's survey,
that indicated that ~80% of Usenet messages are
MIME-formatted. That is anything but a consensus to the
opposite.
Yours are the only messages here which contain Mime attachments.
Which looks like a consensus to me.

Anyway, I give up. I can't argue with stupidity and anti-social
behavior. (It's not as if you actuallly contributed anything
positive to the group.)

--
James Kanze (GABI Software) email:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
Jul 30 '08 #22
Sam
James Kanze writes:
On Jul 29, 1:16 pm, Sam <s...@email-scan.comwrote:
>James Kanze writes:
On Jul 28, 1:10 pm, Sam <s...@email-scan.comwrote:
James Kanze writes:
Exactly. And since the standard policy in newsgroups in the big
eight is not to allow MIME, it doesn't apply here.
>There is no such policy.

There always has been.
Well, wher else it? For something that's supposedly been around, for so
long, it's quite difficult to find.
There's also a policy of lurking a month before posting, to see
what is acceptable and what isn't. Had you done that, you'd see
that no one else uses Mime attachments, because they aren't
considered acceptable.
Very few people use traditional sigs, all that means is that they choose not
to use them, and it does mean that traditional sigs are "considered
unacceptable". False dichotomy.
I don't post in MIME.
>Yes, you do. Every one of your messages is MIME formatted.

Obviously, you don't know what MIME is (and haven't even read
the RFC which you signaled).
Since you don't know, MIME specifies how to format messages beyond the
traditional US-ASCII only character set. This is done by having a
"Mime-Version:" header indicate that your message is MIME-formatted, and
additional "Content-" headers that describe the attributes. Your messages
meet those requirements, and your message are MIME message. So, before you
start demanding that others stop using MIME, you need to take the first
step, yourself.
Anyway, I'm not going to waste my time arguing with you. Anyone
can read the relevant RFC's if they want.
Correct, and they will conclude that your messages are MIME messages.
>Now look at the original whiner's complaint. That's not
exactly what he claimed.
Yes it is.
>No, it's not.

The original complaint was that he didn't automatically see your
response. Which is due to the fact that your response is in a
Mime attachment, and his newsreader doesn't automatically open
Mime attachments.
My response is not a MIME attachment, it's an inline MIME entity. His
newsreader has a known bug that fails to properly implement MIME multipart
parsing, and shows the entire message as a single attachment, when it is
not.

You really should learn something about the subject you choose to comment so
extensively on.
>It's a moderated newsgroup. Moderated newsgroups may set their
own rules.

All groups set their own rules.
Not necessarily.
In the case of this group, the
group was founded before the current rules for group creation
went into effect, so it gets the default set of rules.

If you want a C++ group in which Mime attachments are allowed,
you're free to create one. There are standard procedured for
it.
There are, indeed, some people who, for some reason, not only prefer to live
in prehistoric, pre-MIME ages, but for some reason demand that others do
too. Fortunately, such relics are few. They're maybe loud, in justifying
their existence, but they are a vanishingly small minority.
>There is no such concensus. I recall reading someone's survey,
that indicated that ~80% of Usenet messages are
MIME-formatted. That is anything but a consensus to the
opposite.

Yours are the only messages here which contain Mime attachments.
Which looks like a consensus to me.
Free clue, Einstein. MIME != MIME attachment. A concept that so far has
succeeded in eluding you.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEABECAAYFAkiQTHMACgkQx9p3GYHlUOIo+QCfex5Zo+jF9l TdCBcH/vp9zeH7
/6MAniX0A00ymT06fqGDrh/0fn/HkBaN
=Q3bA
-----END PGP SIGNATURE-----

Jul 30 '08 #23
"Sam" <sa*@email-scan.comwrote in message
news:co******************************@commodore.em ail-scan.com...

[...]

Pan displays your MIME attachments inline.

Jul 30 '08 #24
Sam
Chris M. Thomasson writes:
"Sam" <sa*@email-scan.comwrote in message
news:co******************************@commodore.em ail-scan.com...

[...]

Pan displays your MIME attachments inline.
In RFC 2183-context "attachment" and "inline" is mutually exclusive. A given
MIME entity is either an attachment entity, or an inline entity, but not
both:

disposition := "Content-Disposition" ":"
disposition-type
*(";" disposition-parm)

disposition-type := "inline"
/ "attachment"
/ extension-token
; values are not case-sensitive
What you obviously meant to say is that Pan shows the main content of my
messages inline, and not as an attachment, as Microsoft's crapware does.

Pan is, obviously, correct.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEABECAAYFAkiQ8Y4ACgkQx9p3GYHlUOLemQCfWuPxBVnnEA T9zT7gPrY9RslN
WVYAn2UE9RUdhvmw2kgWrmOOXb2QtpVT
=9ils
-----END PGP SIGNATURE-----

Jul 30 '08 #25
Chris M. Thomasson writes:
"Sam" <sa*@email-scan.comwrote in message
news:co******************************@commodore.em ail-scan.com...

[...]

Pan displays your MIME attachments inline.
In RFC 2183-context "attachment" and "inline" is mutually exclusive. A
given
MIME entity is either an attachment entity, or an inline entity, but not
both:
[...]

What you obviously meant to say is that Pan shows the main content of my
messages inline, and not as an attachment, as Microsoft's crapware does.
Pan is, obviously, correct.
Indeed.

Jul 31 '08 #26
On Jul 27, 11:21*pm, Sam <s...@email-scan.comwrote:
All my messages are always posted in plain text, and not an attachment:

Content-Type: text/plain; format=flowed; charset="US-ASCII"
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

Strangely, I am getting this...

Content-Type: text/trolling; format=flowed_logic; charset="US-ASCII"
Content-Disposition: inline
Content-Transfer-Encoding: 7bit
Jul 31 '08 #27

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

Similar topics

7
by: FrancisC | last post by:
How can I open a file, skip first 2 lines and get the 50th character? EXP 0 R:\000\un\111\e00\e00noLog\1006\bdry_arc.e00 ARC 2 1 1 0 0 0 0 7 ...
2
by: Gary | last post by:
Morning all, I have a form field called: Bsk01 How do I onBlur prompt the user to enter a ZERO as character one, if one is not already entered. At the same time, I would like to ensure at...
8
by: Mr. B | last post by:
In VB6, I had some code which 'forced' the first character of a string entered to be Capital. For example, if a person was entering their name (john doe)... the code would 'force' --- John Doe. ...
4
by: Theron NightStar | last post by:
I am trying to teach myself c++. This is the first program I have ever written that might have an practical use to me. I rather proud of it since like implied - I have no real knowledge of c++. ...
15
by: Beeeeeves | last post by:
Is there a quick way to find the index of the first character different in two strings? For instance, if I had the strings "abcdefghijkl" and "abcdefxyz" I would want the return value to be...
2
by: D.Frangiskatos | last post by:
Hi, I have been working for a few months in project that deals raw sockets. However recently, and while trying to examine the contents of the buffer used in recvfrom i was a bit confused. The...
43
by: Roger L. Cauvin | last post by:
Say I have some string that begins with an arbitrary sequence of characters and then alternates repeating the letters 'a' and 'b' any number of times, e.g. "xyz123aaabbaabbbbababbbbaaabb" I'm...
36
by: Chuck Faranda | last post by:
I'm trying to debug my first C program (firmware for PIC MCU). The problem is getting serial data back from my device. My get commands have to be sent twice for the PIC to respond properly with...
26
by: tesh.uk | last post by:
Hi Gurus, I have written the following code with the help of Ivor Horton's Beginning C : // Structures, Arrays of Structures. #include "stdafx.h" #include "stdio.h" #define MY_ARRAY 15
5
by: sniipe | last post by:
Hi, I have a problem with unicode string in Pylons templates(Mako). I will print first char from my string encoded in UTF-8 and urllib.quote(), for example string '£ukasz': ...
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
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.