A few questiosn about encoding

  • Thread starter Íéêüëáïò Êïýñáò
  • Start date
A

Antoon Pardon

Op 14-06-13 10:37, Nick the Gr33k schreef:
How do we separate a number then from its represenation-natation?
What do you mean? Internally there is no representation linked
to the number, so there is nothing to be seperated. Only when
a number needs to be printed, is a representation for that
number built and displayed.

What is a notation anywat? is it a way of displayment? but that would
be a represeantion then....
Yes a notation is a representation. However "represenation" is also
a bit of python jargon that has a specific meaning. So in order to
not confuse with multiple possible meanings for "representation" I
chose to use "notation"

So everything we see like:

16474
nikos
abc123

everything is a string and nothing is a number? not even number 1?
There is a difference between "everything we see" as you
write earlier and just plain "eveything" as you write
later. Python works with numbers, but at the moment
it has to display such a number it has to produce something
that is printable. So it will build a string that can be
used as a notation for that number, a numeral. And that
is what will be displayed.
 
A

Antoon Pardon

Op 14-06-13 11:32, Nick the Gr33k schreef:
I'mm not trolling man, i just have hard time understanding why numbers
acts as strings.
They don't. No body claimed numbers acted like strings. What was explained,
was that when numbers are displayed, they are converted into a notational
string, which is then displayed. This to clear you of your confusion between
numerals and numbers which you displayed by writing something like "the
binary representation as a number"
 
R

rusi

funny anymore. Why doesn't killfiling work with the mailing list version of
the python list? :-(

I have skimmed the archives for this month, and I estimate that a third of
this month's activity on this list was helping this person. About 80% of
that is wasted in explaining basic concepts he refuses to read in links
given to him. A depressingly large number of replies to his posts are
seemingly ignored.

Since this is a lot of spam, I feel like leaving the list, but I also
honestly want to help people use python and the replies to questions of
others often give me much insight on several matters.

Adding my +1 to this sentiment.

In older saner and more politically incorrect times, when there was a
student who was as idiotic as Nikos, he would be made to:
-- run five rounds of the field
-- stay after school
-- write pages of "I shall not talk in class"

In the age of cut-n-paste the last has lost its sting. Likewise the
first two are hard to administer across the internet.
Still if we are genuinely interested in solving this problem, ways may
be found, for example:

Any question from Nikos that has any English error, should be returned
with:
Correct your English before we look at your python.

If he is brazen enough to correct one error and leave the other 35,
then we put in a 24-hour delay for each reply.

I am sure others can come up with better solutions if we wish.

The alternative is that this disease has an unfavorable prognosis:
[Yes Nikos is an infectious disease: I believe I can pull out mails
from Steven and Grant Edwards whic hare begng tolook sspcicious ly
like Nikos [Sorry Im not much good at imitation!] ]

And that unfavorable prognosis is what Fabio is suggesting -- people
will start leaving the list/group.

Nikos:
This is not against you personally. Just your current mode of conduct
towards this list.
And that mode quite simply is this: You have no interest in python,
you are only interested in the immediate questions of your web-hosting.
 
M

Mark Lawrence

Since this is a lot of spam, I feel like leaving the list, but I also
honestly want to help people use python and the replies to questions of
others often give me much insight on several matters.

Plenty of genuine people needing genuine help on the tutor mailing list,
or have you been there already?

--
"Steve is going for the pink ball - and for those of you who are
watching in black and white, the pink is next to the green." Snooker
commentator 'Whispering' Ted Lowe.

Mark Lawrence
 
R

rusi

Adding my +1 to this sentiment.

Since identifying a disease by the right name is key to finding a
cure:
Nikos is not trolling or spamming; he is help-vampiring.

Lets call it that.
 
H

Heiko Wundram

Am 14.06.2013 14:09, schrieb rusi:
Since identifying a disease by the right name is key to finding a
cure:
Nikos is not trolling or spamming; he is help-vampiring.

Just to explain the trolling allegation: I'm not talking about him
wanting to get his scripts fixed, that's help-vampiring most certainly,
and an extreme form of that (thanks btw. for pointing me to that term,
whoever did).

I was talking about his repeated attempts at "making conversation" by
asking questions about encoding, short-circuit evaluation and such which
seem like they are relevant for him to solve his problem, but due to his
persistence of understanding things in a wrong way/not understanding
them at all/repeating the same misunderstandings time after time have
drifted off into endless repetitions of the same facts by helpful
posters, and have gotten a lot of people seriously annoyed (also, due to
other facts such as him changing his NNTP hosts and/or From-addresses
which breaks kill-filing).

Now, if that latter behaviour isn't trolling, I don't know what is.
Simply nobody who takes what he does at least a little bit serious is
_as_ thick as he makes himself seem.
 
N

Nick the Gr33k

Op 14-06-13 11:32, Nick the Gr33k schreef:

They don't. No body claimed numbers acted like strings. What was explained,
was that when numbers are displayed, they are converted into a notational
string, which is then displayed. This to clear you of your confusion between
numerals and numbers which you displayed by writing something like "the
binary representation as a number"
Hold on.

number = an abstract sense
numeral = ?
notation = ?
represenation = ?
 
N

Nick the Gr33k

| On 14/6/2013 11:22 πμ, Antoon Pardon wrote:
|
| >>Python prints numbers:
| >No it doesn't, numbers are abstract concepts that can be represented in
| >various notations, these notations are strings. Those notaional strings
| >end up being printed. As I said before we are so used in using the
| >decimal notation that we often use the notation and the number interchangebly
| >without a problem. But when we are working with multiple notations that
| >can become confusing and we should be careful to seperate numbers from their
| >representaions/notations.
|
| How do we separate a number then from its represenation-natation?

Shrug. When you "print" a number, Python transcribes a string
representation of it to your terminal.
16

So the output 16 is in fact a string representation of the number 16 ?

Then in what 16 and '16; differ to?
| What is a notation anywat? is it a way of displayment? but that
| would be a represeantion then....

Yep. Same thing. A "notation" is a particulart formal method of
representation.


Can you elaborate please?
| No it doesn't, numbers are abstract concepts that can be represented in
| various notations
|
| >>but when we need a decimal integer
| >
| >There are no decimal integers. There is only a decimal notation of the number.
| >Decimal, octal etc are not characteristics of the numbers themselves.
|
| So everything we see like:
|
| 16474
| nikos
| abc123
|
| everything is a string and nothing is a number? not even number 1?

Everything you see like that is textual information. Internally to
Python, various types are used: strings, bytes, integers etc. But
when you print something, text is output.

Cheers,
Thanks!
 
J

Joel Goldstick

go away Nick. Go far away. You are not a good person. You are not even a
good Troll. You are just nick the *ick. You should take up something you
can do better than this.. like maybe sleeping
 
N

Nick the Gr33k

funny anymore. Why doesn't killfiling work with the mailing list version
of the python list? :-(

I have skimmed the archives for this month, and I estimate that a third
of this month's activity on this list was helping this person. About 80%
of that is wasted in explaining basic concepts he refuses to read in
links given to him. A depressingly large number of replies to his posts
are seemingly ignored.

Since this is a lot of spam, I feel like leaving the list, but I also
honestly want to help people use python and the replies to questions of
others often give me much insight on several matters.
I'am not spamming and as you say i dare to ask what other don't if they
don't understand something.
I'am not trolling and actually help people with my questions(as you
admitted yourself) and you are helping with your replies.

we are all benefit out of this.
 
N

Nick the Gr33k

Nikos:
This is not against you personally. Just your current mode of conduct
towards this list.
And that mode quite simply is this: You have no interest in python,
you are only interested in the immediate questions of your web-hosting.

If that was True i wouldn't be asking to be given detailed explanations
of a solution provided to me, neither would i been asked to understand
why the way i tried it is wrong and what was the correct way of writing
the code and why.

So, if i had no interest of actually learning python i would just cut n'
paste provided code without worrying what it actually does, since
knowing that came form you would be enough to know that works.
 
N

Nick the Gr33k

Python works with numbers, but at the moment
it has to display such a number it has to produce something
that is printable. So it will build a string that can be
used as a notation for that number, a numeral. And that
is what will be displayed.

so a number is just a number but when this number needs to be displayed
into a monitor, then the printed form of that number we choose to call
it a numeral?

So, a numeral = a string representation of a number. Is this correct?
 
A

Antoon Pardon

Op 14-06-13 14:36, Nick the Gr33k schreef:
Hold on.
number = an abstract sense
numeral = ?
notation = ?
represenation = ?
I already explained these in previous responses. I am not going to repeat
myself. IMO you are out of place here. You belong in a tutor class about
basical computing concepts. There you can aquire the knowledge that is
more or less expected of those who want to contribute here. I don't mind
the occasional gap in knowledge but with you it seems more there is an
occasional grain of knowledge in a sea of ignorance. To remedy the former
a single explanation is mostly sufficient. To remedy the latter you need
a tutorial course.

Now there is nothing wrong in being ignorant. The question is how do you
proceed from there. The answer is not by starting a project that is far
above your ability and pestering the experts in the hope they will spoon
feed you.
 
F

Fábio Santos

Am 14.06.2013 14:45, schrieb Nick the Gr33k:



Let's nominate you for a nobel prize, saviour of python-list!

I don't want to be saved. I just found out how to mute conversations in gmail.
 
Z

Zero Piraeus

:

So, if i had no interest of actually learning python i would just cut n'
paste provided code without worrying what it actually does, since knowing
that came form you would be enough to know that works.

Worrying what it actually does is good; an inquiring mind is a
prerequisite for becoming a good programmer.

Another prerequisite is discipline. That means the discipline to try
and work out for yourself what's going on, rather than repeatedly
spamming this list with trivial enquiries.

It also means the discipline to both read and type carefully: until
and unless you learn to take more care in how you express yourself,
both in code and in prose, you will be plagued by syntax errors and
frustrated responses respectively.

I have only skimmed it, but you might find the following tutorial helpful:

http://learnpythonthehardway.org/

Many of the early exercises may seem too basic, and you'll be tempted
to skip them - given your conduct here, I imagine you'll be *strongly*
tempted to skip them. Don't. You need to learn discipline.

-[]z.
 
A

Antoon Pardon

Op 14-06-13 14:59, Nick the Gr33k schreef:
so a number is just a number but when this number needs to be displayed
into a monitor, then the printed form of that number we choose to call
it a numeral?
So, a numeral = a string representation of a number. Is this correct?
Yes, when you print an integer, what actually happens is something along
the following algorithm (python 2 code):


def write_int(out, nr):
ord0 = ord('0')
lst = []
negative = False
if nr < 0:
negative = True
nr = -nr
while nr:
digit = nr % 10
lst.append(chr(digit + ord0))
nr /= 10
if negative:
lst.append('-')
lst.reverse()
if not lst:
lst.append('0')
numeral = ''.join(lst)
out.write(numeral)
 
N

Nick the Gr33k

Normally a character in a b'...' item represents the byte value
matching the character's Unicode ordinal value.

The only thing that i didn't understood is this line.
First please tell me what is a byte value
\x1b is a sequence you find inside strings (and "byte" strings, the
b'...' format).

\x1b is a character(ESC) represented in hex format

b'\x1b' is a byte object that represents what?

'\x1b'

After decoding it gives the char ESC in hex format
Shouldn't it result in value 27 which is the ordinal of ESC ?
No, I mean conceptually, there is no difference between a code-point
and its ordinal value. They are the same thing.

Why Unicode charset doesn't just contain characters, but instead it
contains a mapping of (characters <--> ordinals) ?

I mean what we do is to encode a character like chr(65).encode('utf-8')

What's the reason of existence of its corresponding ordinal value since
it doesn't get involved into the encoding process?

Thank you very much for taking the time to explain.
 
J

Joel Goldstick

let's cut to the chase and start with telling us what you DO know Nick.
That would take less typing
 
N

Nick the Gr33k

let's cut to the chase and start with telling us what you DO know Nick.
That would take less typing
Well, my biggest successes up until now where to build 3 websites
utilizing database saves and retrievals

in PHP
in Perl
and later in Python

with absolute ignorance of

Apache Configuration:
CGI:
Linux:

with just basic knowledge of linux.
I'am very proud of it.
 

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top