unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* About "set bits"
@ 2013-04-10 13:46 Xue Fuqiao
  2013-04-10 14:15 ` Thien-Thi Nguyen
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Xue Fuqiao @ 2013-04-10 13:46 UTC (permalink / raw)
  To: help-gnu-emacs

In (info "(elisp) Bindat Spec"):

  `bits LEN'
     List of set bits in LEN bytes.  The bytes are taken in big endian
     order and the bits are numbered starting with `8 * LEN - 1' and
     ending with zero.  For example: `bits 2' unpacks `#x28' `#x1c' to
     `(2 3 4 11 13)' and `#x1c' `#x28' to `(3 5 10 11 12)'.

I don't know what "set bits" means here.  I have searched the archives,
and found two related threads:
http://lists.gnu.org/archive/html/help-gnu-emacs/2005-06/msg00087.html
http://lists.gnu.org/archive/html/help-gnu-emacs/2013-01/msg00103.html

But they didn't help.  I have also searched the web and seen the
commentary header of bindat.el, but nothing helped to me.  Can I get a
pointer to information on this concept (or on byte packing)?

-- 
Xue Fuqiao

English is not my native language; please excuse typing errors.



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: About "set bits"
  2013-04-10 13:46 About "set bits" Xue Fuqiao
@ 2013-04-10 14:15 ` Thien-Thi Nguyen
  2013-04-10 15:20 ` Eli Zaretskii
       [not found] ` <mailman.23883.1365607222.855.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 10+ messages in thread
From: Thien-Thi Nguyen @ 2013-04-10 14:15 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 280 bytes --]

() Xue Fuqiao <xfq.free@gmail.com>
() Wed, 10 Apr 2013 21:46:27 +0800

   I don't know what "set bits" means here.

See <http://foldoc.org/bit>, which defines "set"
(and "clear") with respect to a "bit".

M-x praise-foldoc RET

-- 
Thien-Thi Nguyen
GPG key: 4C807502

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: About "set bits"
  2013-04-10 13:46 About "set bits" Xue Fuqiao
  2013-04-10 14:15 ` Thien-Thi Nguyen
@ 2013-04-10 15:20 ` Eli Zaretskii
       [not found] ` <mailman.23883.1365607222.855.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 10+ messages in thread
From: Eli Zaretskii @ 2013-04-10 15:20 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Wed, 10 Apr 2013 21:46:27 +0800
> From: Xue Fuqiao <xfq.free@gmail.com>
> 
> In (info "(elisp) Bindat Spec"):
> 
>   `bits LEN'
>      List of set bits in LEN bytes.  The bytes are taken in big endian
>      order and the bits are numbered starting with `8 * LEN - 1' and
>      ending with zero.  For example: `bits 2' unpacks `#x28' `#x1c' to
>      `(2 3 4 11 13)' and `#x1c' `#x28' to `(3 5 10 11 12)'.
> 
> I don't know what "set bits" means here.

It means bits that are set, i.e. their value is 1.



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: About "set bits"
       [not found] ` <mailman.23883.1365607222.855.help-gnu-emacs@gnu.org>
@ 2013-04-10 15:37   ` Barry Margolin
  2013-04-10 22:33     ` Xue Fuqiao
                       ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Barry Margolin @ 2013-04-10 15:37 UTC (permalink / raw)
  To: help-gnu-emacs

In article <mailman.23883.1365607222.855.help-gnu-emacs@gnu.org>,
 Eli Zaretskii <eliz@gnu.org> wrote:

> > Date: Wed, 10 Apr 2013 21:46:27 +0800
> > From: Xue Fuqiao <xfq.free@gmail.com>
> > 
> > In (info "(elisp) Bindat Spec"):
> > 
> >   `bits LEN'
> >      List of set bits in LEN bytes.  The bytes are taken in big endian
> >      order and the bits are numbered starting with `8 * LEN - 1' and
> >      ending with zero.  For example: `bits 2' unpacks `#x28' `#x1c' to
> >      `(2 3 4 11 13)' and `#x1c' `#x28' to `(3 5 10 11 12)'.
> > 
> > I don't know what "set bits" means here.
> 
> It means bits that are set, i.e. their value is 1.

Xue's questions about documentation often seem to suggest that he 
doesn't know how to parse English. He frequently tries to interpret 
phrases as computer or Emacs jargon, when they just have the meaning the 
words imply.

-- 
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: About "set bits"
  2013-04-10 15:37   ` Barry Margolin
@ 2013-04-10 22:33     ` Xue Fuqiao
  2013-04-10 22:39       ` Xue Fuqiao
  2013-04-11  8:46     ` Thien-Thi Nguyen
       [not found]     ` <mailman.23943.1365669842.855.help-gnu-emacs@gnu.org>
  2 siblings, 1 reply; 10+ messages in thread
From: Xue Fuqiao @ 2013-04-10 22:33 UTC (permalink / raw)
  To: help-gnu-emacs

On Wed, 10 Apr 2013 11:37:19 -0400
Barry Margolin <barmar@alum.mit.edu> wrote:

> In article <mailman.23883.1365607222.855.help-gnu-emacs@gnu.org>,
>  Eli Zaretskii <eliz@gnu.org> wrote:
> 
> > > Date: Wed, 10 Apr 2013 21:46:27 +0800
> > > From: Xue Fuqiao <xfq.free@gmail.com>
> > > 
> > > In (info "(elisp) Bindat Spec"):
> > > 
> > >   `bits LEN'
> > >      List of set bits in LEN bytes.  The bytes are taken in big endian
> > >      order and the bits are numbered starting with `8 * LEN - 1' and
> > >      ending with zero.  For example: `bits 2' unpacks `#x28' `#x1c' to
> > >      `(2 3 4 11 13)' and `#x1c' `#x28' to `(3 5 10 11 12)'.
> > > 
> > > I don't know what "set bits" means here.
> > 
> > It means bits that are set, i.e. their value is 1.

I see, thanks.

> Xue's questions about documentation often seem to suggest that he 
> doesn't know how to parse English.  He frequently tries to interpret 
> phrases as computer or Emacs jargon, when they just have the meaning the 
> words imply.

I think you're right, and I'm trying to improve this problem.

-- 
Xue Fuqiao
http://www.gnu.org/software/emacs/



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: About "set bits"
  2013-04-10 22:33     ` Xue Fuqiao
@ 2013-04-10 22:39       ` Xue Fuqiao
  0 siblings, 0 replies; 10+ messages in thread
From: Xue Fuqiao @ 2013-04-10 22:39 UTC (permalink / raw)
  To: help-gnu-emacs

On Thu, 11 Apr 2013 06:33:28 +0800
Xue Fuqiao <xfq.free@gmail.com> wrote:

> > Xue's questions about documentation often seem to suggest that he 
> > doesn't know how to parse English.  He frequently tries to interpret 
> > phrases as computer or Emacs jargon, when they just have the meaning the 
> > words imply.
> 
> I think you're right, and I'm trying to improve this problem.
                                          ^^^^^^^
                                          resolve 
-- 
Xue Fuqiao
http://www.gnu.org/software/emacs/



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: About "set bits"
  2013-04-10 15:37   ` Barry Margolin
  2013-04-10 22:33     ` Xue Fuqiao
@ 2013-04-11  8:46     ` Thien-Thi Nguyen
       [not found]     ` <mailman.23943.1365669842.855.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 10+ messages in thread
From: Thien-Thi Nguyen @ 2013-04-11  8:46 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 910 bytes --]

() Barry Margolin <barmar@alum.mit.edu>
() Wed, 10 Apr 2013 11:37:19 -0400

   phrases as computer or Emacs jargon, when they just have the meaning
   the words imply.

Assuming that one can parse "set bit" as ADJ N, there is still room for
confusion.  Being around computers for a long time, i interpret "set" as
"having value 1", but recognize anyway that such is not universal.

For example, in the phrase "ready, set, go", the state "set" gives the
impression of suspense, promise, potential.  The poet in me imagines how
zero embodies that, mapping these states to -1, 0, and 1, respectively.

"But ttn, we're talking about Emacs Lisp and specifically binary data!"

Yes.  No one is born programmer or poet, yet both can hack (in) Emacs.
What is confusion but a stretching of the mind?  What is Emacs but
confusion, parenthesized and shared?

-- 
Thien-Thi Nguyen
GPG key: 4C807502

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: About "set bits"
       [not found]     ` <mailman.23943.1365669842.855.help-gnu-emacs@gnu.org>
@ 2013-04-11 15:19       ` Barry Margolin
  2013-04-12  4:39         ` Thien-Thi Nguyen
  0 siblings, 1 reply; 10+ messages in thread
From: Barry Margolin @ 2013-04-11 15:19 UTC (permalink / raw)
  To: help-gnu-emacs

In article <mailman.23943.1365669842.855.help-gnu-emacs@gnu.org>,
 Thien-Thi Nguyen <ttn@gnuvola.org> wrote:

> () Barry Margolin <barmar@alum.mit.edu>
> () Wed, 10 Apr 2013 11:37:19 -0400
> 
>    phrases as computer or Emacs jargon, when they just have the meaning
>    the words imply.
> 
> Assuming that one can parse "set bit" as ADJ N, there is still room for
> confusion.  Being around computers for a long time, i interpret "set" as
> "having value 1", but recognize anyway that such is not universal.
> 
> For example, in the phrase "ready, set, go", the state "set" gives the
> impression of suspense, promise, potential.  The poet in me imagines how
> zero embodies that, mapping these states to -1, 0, and 1, respectively.
> 
> "But ttn, we're talking about Emacs Lisp and specifically binary data!"
> 
> Yes.  No one is born programmer or poet, yet both can hack (in) Emacs.
> What is confusion but a stretching of the mind?  What is Emacs but
> confusion, parenthesized and shared?

True, these phrases can be ambiguous. But often the context and examples 
help quite a bit in figuring out the intent. In this case, there were a 
couple of examples; "bits" tells you to think in binary, and if you 
examined the binary values of the examples it should quickly become 
apparent what was meant.

-- 
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: About "set bits"
  2013-04-11 15:19       ` Barry Margolin
@ 2013-04-12  4:39         ` Thien-Thi Nguyen
  2013-04-12 14:20           ` Xue Fuqiao
  0 siblings, 1 reply; 10+ messages in thread
From: Thien-Thi Nguyen @ 2013-04-12  4:39 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 1262 bytes --]

() Barry Margolin <barmar@alum.mit.edu>
() Thu, 11 Apr 2013 11:19:54 -0400

   True, these phrases can be ambiguous. But often the context and
   examples help quite a bit in figuring out the intent. In this case,
   there were a couple of examples; "bits" tells you to think in binary,
   and if you examined the binary values of the examples it should
   quickly become apparent what was meant.

Yes, i think if OP were to try more stuff in *scratch*, such questions
could be avoided.  In this case, i wrote examples that (to me) seem easy
to inspect and mentally verify, so that *scratch* is not even necessary.

(Although probably they could use some additional bit-field diagrams:

   1
   5      8 7      0
  ┌────────┬────────┐
  │00101000│00011100│  =>  (2 3 4 11 13)
  └────────┴────────┘
      28       1C

and

   1
   5      8 7      0
  ┌────────┬────────┐
  │00011100│00101000│  =>  (3 5 10 11 12)
  └────────┴────────┘
      1C       28

Let's hope people will step forward and improve the docs over time.)

-- 
Thien-Thi Nguyen
GPG key: 4C807502

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: About "set bits"
  2013-04-12  4:39         ` Thien-Thi Nguyen
@ 2013-04-12 14:20           ` Xue Fuqiao
  0 siblings, 0 replies; 10+ messages in thread
From: Xue Fuqiao @ 2013-04-12 14:20 UTC (permalink / raw)
  To: help-gnu-emacs

On Fri, 12 Apr 2013 06:39:17 +0200
Thien-Thi Nguyen <ttn@gnuvola.org> wrote:

> () Barry Margolin <barmar@alum.mit.edu>
> () Thu, 11 Apr 2013 11:19:54 -0400
> 
>    True, these phrases can be ambiguous. But often the context and
>    examples help quite a bit in figuring out the intent. In this case,
>    there were a couple of examples; "bits" tells you to think in binary,
>    and if you examined the binary values of the examples it should
>    quickly become apparent what was meant.
> 
> Yes, i think if OP were to try more stuff in *scratch*, such questions
> could be avoided.

Agreed.  Although I prefer *ielm*.

> In this case, i wrote examples that (to me) seem easy to inspect and
> mentally verify, so that *scratch* is not even necessary.

But I'm not familiar with binary files and binary code, I don't where to
start.

> Let's hope people will step forward and improve the docs over time.)

That's true.  Although my English isn't very good, I'd be glad to
improve/refine the documentation for Emacs, like proof-reading the
manuals and adding documentation about some packages/features that
aren't mentioned in the manuals.

-- 
Xue Fuqiao
http://www.gnu.org/software/emacs/



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2013-04-12 14:20 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-10 13:46 About "set bits" Xue Fuqiao
2013-04-10 14:15 ` Thien-Thi Nguyen
2013-04-10 15:20 ` Eli Zaretskii
     [not found] ` <mailman.23883.1365607222.855.help-gnu-emacs@gnu.org>
2013-04-10 15:37   ` Barry Margolin
2013-04-10 22:33     ` Xue Fuqiao
2013-04-10 22:39       ` Xue Fuqiao
2013-04-11  8:46     ` Thien-Thi Nguyen
     [not found]     ` <mailman.23943.1365669842.855.help-gnu-emacs@gnu.org>
2013-04-11 15:19       ` Barry Margolin
2013-04-12  4:39         ` Thien-Thi Nguyen
2013-04-12 14:20           ` Xue Fuqiao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).