char to decimal

  • Thread starter Dirk Bruere at NeoPax
  • Start date
L

Lew

markspace said:
Dirk said:
I need it to match the packet i/f [?] specs designed by somemone else that
requires text characters be sent as decimal ascii [sic]


That's a really odd requirement. Your spec might mean just regular text. Not
ascii text, as in the character 9 followed by the character 7, but just 'a' as
a literal 97 byte value.

Just saying.

What value does that spec indicate to transmit, say, the characters 'æ' or
'À', Dirk?
 
A

Andreas Leitgeb

Paul Cager said:
Two values are defined for "public use" - 1231 and 1237

A good one :)
And while we're at it, we'll revolutionize maths by coming up
with a new field theory whose two operations have 1231 and 1237
as their respective neutral elements...
(java.lang.Boolean's hashcode()). I think they should take
precedence over any "internal use only" values.

Yep, these or even better 64 and 43 for true and false, just
heaven forbid 1 and 0 - that's so ... boring simple, innit?
 
L

Lew

A good one :)
And while we're at it, we'll revolutionize maths by coming up
with a new field theory whose two operations have 1231 and 1237
as their respective neutral elements...


Yep, these or even better 64 and 43 for true and false, just
heaven forbid 1 and 0 - that's so ... boring simple, innit?

I do believe that as long as I'm using Java booleans, I'll stick with the
values 'true' and 'false'. That seems like the natural mapping to me.

Just saying.
 
A

Andreas Leitgeb

Lew said:
markspace said:
Dirk said:
I need it to match the packet i/f [?] specs designed by somemone else that
requires text characters be sent as decimal ascii [sic]
That's a really odd requirement. Your spec might mean just regular text. Not
ascii text, as in the character 9 followed by the character 7, but just 'a' as
a literal 97 byte value.
What value does that spec indicate to transmit, say, the characters 'æ' or
'À', Dirk?

Or for this one 'µ' (\u00b5) or perhaps that one 'μ' (\u03bc) ? :)
I tend to assume, that the mentioned 'someone else' either just didn't
think of international letters, or thought of those and consciously
discarded them as irrelevant for this particular packet i/f...

PS: My guess is, that i/f means interface.
 
L

Lew

Lew said:
markspace said:
Dirk Bruere at NeoPax wrote:
I need it to match the packet i/f [?] specs designed by somemone else that
requires text characters be sent as decimal ascii [sic]
That's a really odd requirement. Your spec might mean just regular text. Not
ascii text, as in the character 9 followed by the character 7, but just 'a' as
a literal 97 byte value.
What value does that spec indicate to transmit, say, the characters 'æ' or
'À', Dirk?

Or for this one 'µ' (\u00b5) or perhaps that one 'μ' (\u03bc) ? :)
I tend to assume, that the mentioned 'someone else' either just didn't
think of international letters, or thought of those and consciously
discarded them as irrelevant for this particular packet i/f...

PS: My guess is, that i/f means interface.

Neither of the values you cited (\u00b5 or \u03bc') is an ASCII value, and
therefore does not meet the stated spec.
 
L

Lawrence D'Oliveiro

I was unaware that any programmaing language, reasonable or not, had
"strong natural association" in mind when deciding on the rules of their
boolean/integer conversion rules.

That might be because they never had.

Or simply that you are unaware.
 
M

Mayeul

Most reasonably-designed programming languages.

I was unaware that any programmaing language, reasonable or not, had
"strong natural association" in mind when deciding on the rules of their
boolean/integer conversion rules.

That might be because they never had.
 
J

Jussi Piitulainen

Mayeul said:
Says who, which one, on what grounds, and what do you make of the swaps?

Graham, Knuth, Patashnik, in Concrete Mathematics: A Foundation for
Computer Science, use to stand for 0 when S is a false statement
and for 1 one when S is a true statement. They attribute the notation
to Iverson, who used round brackets. They find the mapping useful.

For example, the sign of x is [x > 0] - [x < 0].

For example, to add 1 to f(x) if n is divisible by m, you could write
f(x) + [n mod m > 0]. (In Java, use the per cent operator to get the
canonical element that is congruent to n modulo m.)

A widely used special case in mathematics is so called Kronecker's
delta that stands for [x = y]. (That's equality, not assignment.)

You get the other mappings quoted above as 1 - 2* and -.

And whatever the two hash values were, call them F and T, you could
get them as F*[not s] + T* where s is the truth value of the
statement S. (In Java, write !s for not s, I think.)

I am not saying that Java should do anything about all this. I am
saying that one of the mappings is already in general use elsewhere,
with established notations for it.
 
A

Andreas Leitgeb

Lew said:
I do believe that as long as I'm using Java booleans, I'll stick with the
values 'true' and 'false'. That seems like the natural mapping to me.

Oh, that must all be a big misunderstanding. I honestly never wanted
to elide these two keywords. They would make excellent self-speaking
integer-literals for particular uses. :)
 
D

Dirk Bruere at NeoPax

markspace said:
Dirk said:
I need it to match the packet i/f [?] specs designed by somemone else
that
requires text characters be sent as decimal ascii [sic]


That's a really odd requirement. Your spec might mean just regular
text. Not
ascii text, as in the character 9 followed by the character 7, but
just 'a' as
a literal 97 byte value.

Just saying.

What value does that spec indicate to transmit, say, the characters 'æ'
or 'À', Dirk?

English alphabet only
 
L

Lew

Lawrence said:
Or simply that you are unaware.

To simply put out snarky indirect and unsupportable crap does not constitute
conversation. Are you afraid to put out statements of fact, reason or logic,
remembering what happened last time you tried to claim a "natural" association
between "true" and some number? You were simply overwhelmed by well
though-out theses that contradicted yours. Is that why you won't offer a
SINGLE point of logic, instead confining yourself to vague, oracular
pronouncements as if you hoped to convince someone that you've actually had a
thought?

As for that particular remark, you are most definitely the pot calling the
kettle black.
 
L

Lew

markspace said:
Dirk Bruere at NeoPax wrote:

I need it to match the packet i/f [?] specs designed by somemone else
that
requires text characters be sent as decimal ascii [sic]


That's a really odd requirement. Your spec might mean just regular
text. Not
ascii text, as in the character 9 followed by the character 7, but
just 'a' as
a literal 97 byte value.

Just saying.

What value does that spec indicate to transmit, say, the characters 'æ'
or 'À', Dirk?

English alphabet only

The English alphabet includes 'æ', 'ë', 'ö', 'œ' and other such symbols not
included in ASCII.
 
A

Andreas Leitgeb

Lew said:
The English alphabet includes 'æ', 'ë', 'ö', 'œ' and other
such symbols not included in ASCII.

I wasn't aware of any particular "English alphabet". There's
however the Latin alphabet, and a subset of it used in
English language. Now, I'm curious about an English sentence
using your particular samples of characters within words.

Oh, and please don't make it a trivial one, like
"'Ö' is not an English letter."
 
J

Joshua Cranmer

I wasn't aware of any particular "English alphabet". There's
however the Latin alphabet, and a subset of it used in
English language. Now, I'm curious about an English sentence
using your particular samples of characters within words.

There is the "standard" English alphabet - A-Z. This also happens to
coincide with, say, the French alphabet. Not that diacritics do not
feature in this alphabet, nor is there any sense of distinction between
`a' and `A', and, finally, nor is there any use of punctuation marks. In
particular, ` ' is not in the English alphabet. Although it does feature
very prominently in most texts written in English.

As for those letters:

Archæology, coöperation, naïve, résumé...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top