Re: [Tutor] little/big endian was Re: what is 'doubleword alignment'?

2011-07-21 Thread Wayne Werner
On Jul 21, 2011 9:23 AM, "Lisi"  wrote:
>
> On Tuesday 19 July 2011 22:43:40 Alan Gauld wrote:
> > Growing to hate my Netbook keyboard more by the day!
>
> Attach another keyboard?  (To keep life simple it would have to be usb,
but
> you can even get a keyboard that will roll up for carrying.  I have
neither
> seen nor tried one, so it may be no good!)
>
> Lisi

Having used and owning the roll up kind, they're not very good. It's very
similar to typing on a bad keyboard with the keys off. I bought a smaller
keyboard for $10 on amazon that had full size keys and was quite nice, until
the stress of sticking it in my backpack shorted the cord. That's what I'd
recommend if you still want something portable, though it's easily the size
of my wife's netbook.

If you want a good keyboard, I'm addicted to mechanical switched keyboards,
despite the price tag.

-Wayne
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] little/big endian was Re: what is 'doubleword alignment'?

2011-07-21 Thread Albert-Jan Roskam
Thanks a lot for your explanations, that was most helpful! I never realized my 
mother tongue (Dutch) is Little Endian, whereas English is Big Endian, e.g.:
dutch: negen-en-twintig (nine-and-twenty)
english: twenty-nine

I will improve my program based on what you all have said. I will let the 
program:
-find out the encoding of the input file
-find out the encoding of the terminal
-if necessary: find out if there are any other, compatible encodings on the 
terminal

Thanks again!

Cheers!!

Albert-Jan



~~

All right, but apart from the sanitation, the medicine, education, wine, public 
order, irrigation, roads, a fresh water system, and public health, what have 
the Romans ever done for us?

~~

--- On Thu, 7/21/11, Steven D'Aprano  wrote:

From: Steven D'Aprano 
Subject: Re: [Tutor] little/big endian was Re: what is 'doubleword alignment'?
To: tutor@python.org
Date: Thursday, July 21, 2011, 2:56 PM

Dave Angel wrote:

> Little-endian is the method used by the Intel processor (such as the 
> Pentium).  Big-endian is the system used by most network protocols, as well 
> as the 68000 and many other processors.

There used to be mainframes with various forms of middle-endian layouts. 
Fortunately they are no longer around.

http://www.retrologic.com/jargon/M/middle-endian.html


> For our purposes, it's the ordering of the bytes within a 16 or 32 bit 
> number.  Little-endian puts the least significant byte first, while 
> big-endian puts the most significant byte first.

In this context, least significant and most significant may need explaining.

In decimal numbers, we write one hundred and twenty-three as 123. The 1 is most 
significant, because it represents 1 HUNDRED rather than 1 UNIT. And similarly 
the 3 is least significant. So numbers using Arabic numerals are big-endian.

The same applies for computer integers. 123 written in hexadecimal is 7B, which 
of course is big-endian just like decimal. But when storing this number in 
memory, we have a choice: we can store it in big-endian format, just like we 
write it: 7B, where the 7 is the "left-most" (lowest address) number. Or we can 
store it in little-endian format, B7, where the 7 has the higher address, and 
read from right-to-left.

And of course, bytes themselves can be either little-endian or big-endian, 
*independently* of byte ordering within larger units.

http://en.wikipedia.org/wiki/Endianness
http://en.wikipedia.org/wiki/Bit_numbering



-- Steven
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] little/big endian was Re: what is 'doubleword alignment'?

2011-07-21 Thread Prasad, Ramit
>Attach another keyboard?  (To keep life simple it would have to be usb, but 
>you can even get a keyboard that will roll up for carrying.  I have neither 
>seen nor tried one, so it may be no good!)

On the plus side, roll-up keyboards tend to be sealed and proof against 
liquids. Plus, they are usually fairly quiet. 

Ramit


Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
work phone: 713 - 216 - 5423



This communication is for informational purposes only. It is not
intended as an offer or solicitation for the purchase or sale of
any financial instrument or as an official confirmation of any
transaction. All market prices, data and other information are not
warranted as to completeness or accuracy and are subject to change
without notice. Any comments or statements made herein do not
necessarily reflect those of JPMorgan Chase & Co., its subsidiaries
and affiliates.

This transmission may contain information that is privileged,
confidential, legally privileged, and/or exempt from disclosure
under applicable law. If you are not the intended recipient, you
are hereby notified that any disclosure, copying, distribution, or
use of the information contained herein (including any reliance
thereon) is STRICTLY PROHIBITED. Although this transmission and any
attachments are believed to be free of any virus or other defect
that might affect any computer system into which it is received and
opened, it is the responsibility of the recipient to ensure that it
is virus free and no responsibility is accepted by JPMorgan Chase &
Co., its subsidiaries and affiliates, as applicable, for any loss
or damage arising in any way from its use. If you received this
transmission in error, please immediately contact the sender and
destroy the material in its entirety, whether in electronic or hard
copy format. Thank you.

Please refer to http://www.jpmorgan.com/pages/disclosures for
disclosures relating to European legal entities.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] little/big endian was Re: what is 'doubleword alignment'?

2011-07-21 Thread Lisi
On Tuesday 19 July 2011 22:43:40 Alan Gauld wrote:
> Growing to hate my Netbook keyboard more by the day!

Attach another keyboard?  (To keep life simple it would have to be usb, but 
you can even get a keyboard that will roll up for carrying.  I have neither 
seen nor tried one, so it may be no good!)

Lisi
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] little/big endian was Re: what is 'doubleword alignment'?

2011-07-21 Thread Steven D'Aprano

Dave Angel wrote:

Little-endian is the method used by the Intel processor (such as the 
Pentium).  Big-endian is the system used by most network protocols, as 
well as the 68000 and many other processors.


There used to be mainframes with various forms of middle-endian layouts. 
Fortunately they are no longer around.


http://www.retrologic.com/jargon/M/middle-endian.html


For our purposes, it's the ordering of the bytes within a 16 or 32 bit 
number.  Little-endian puts the least significant byte first, while 
big-endian puts the most significant byte first.


In this context, least significant and most significant may need explaining.

In decimal numbers, we write one hundred and twenty-three as 123. The 1 
is most significant, because it represents 1 HUNDRED rather than 1 UNIT. 
And similarly the 3 is least significant. So numbers using Arabic 
numerals are big-endian.


The same applies for computer integers. 123 written in hexadecimal is 
7B, which of course is big-endian just like decimal. But when storing 
this number in memory, we have a choice: we can store it in big-endian 
format, just like we write it: 7B, where the 7 is the "left-most" 
(lowest address) number. Or we can store it in little-endian format, B7, 
where the 7 has the higher address, and read from right-to-left.


And of course, bytes themselves can be either little-endian or 
big-endian, *independently* of byte ordering within larger units.


http://en.wikipedia.org/wiki/Endianness
http://en.wikipedia.org/wiki/Bit_numbering



--
Steven
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] little/big endian was Re: what is 'doubleword alignment'?

2011-07-20 Thread Dave Angel

On 07/19/2011 05:43 PM, Alan Gauld wrote:

Albert-Jan Roskam wrote:
> and ctypes to process the data in python. It works now, although I
> still want to read more about this. Where does the distinction
> little/big endian enter this story?

That's to do with which bit in a byte/word is most significant.

e.g. is the decimal value 1 stored as

0001   # the one on the right hand nibble
or as
0001   # the one on the left hand nibble

Now scale that up to word sized numbers...
Different CPUs do it differently.

I can't recall which is which - I'm sure wikipedia will
reveal all! :-)
Little-endian is the method used by the Intel processor (such as the 
Pentium).  Big-endian is the system used by most network protocols, as 
well as the 68000 and many other processors.


For our purposes, it's the ordering of the bytes within a 16 or 32 bit 
number.  Little-endian puts the least significant byte first, while 
big-endian puts the most significant byte first.


--

DaveA

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] little/big endian was Re: what is 'doubleword alignment'?

2011-07-20 Thread Alan Gauld

Albert-Jan Roskam wrote:
> and ctypes to process the data in python. It works now, although I
> still want to read more about this. Where does the distinction
> little/big endian enter this story?

That's to do with which bit in a byte/word is most significant.

e.g. is the decimal value 1 stored as

0001   # the one on the right hand nibble
or as
0001   # the one on the left hand nibble

Now scale that up to word sized numbers...
Different CPUs do it differently.

I can't recall which is which - I'm sure wikipedia will
reveal all! :-)

HTH,

Alan G.
Growing to hate my Netbook keyboard more by the day!
And hating my PC repairer even more!
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor