Hellow!!! Really i'm Gnus' fan so i'm wondering Gnus' message-id have some secret. According my view: gnu/linux start with "87" darwin start with "m2" windows-nt start with "86" or "83" I saw the source code in message.el but still i do not understand. Somebody explain about that? Sincerely, -- ^고맙습니다 _地平天成_ 감사합니다_^))//
On Nov 16 2019, 황병희 wrote:
> According my view:
> gnu/linux start with "87"
> darwin start with "m2"
> windows-nt start with "86" or "83"
The first number is always (user-uid). "87" is 1000, "m2" is 501, "86"
is 1001, "83" is 1004.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1
"And now for something completely different."
황병희 writes: > Really i'm Gnus' fan so i'm wondering Gnus' message-id have some secret. Secret? > According my view: > gnu/linux start with "87" > darwin start with "m2" > windows-nt start with "86" or "83" > > I saw the source code in message.el but still i do not > understand. Somebody explain about that? This is the function you want to understand: (defun message-unique-id () ;; Don't use microseconds from (current-time), they may be unsupported. ;; Instead we use this randomly inited counter. (setq message-unique-id-char (% (1+ (or message-unique-id-char (random (ash 1 20)))) ;; (current-time) returns 16-bit ints, ;; and 2^16*25 just fits into 4 digits i base 36. (* 25 25))) (let ((tm (current-time))) (concat (if (or (eq system-type 'ms-dos) ;; message-number-base36 doesn't handle bigints. (floatp (user-uid))) (let ((user (downcase (user-login-name)))) (while (string-match "[^a-z0-9_]" user) (aset user (match-beginning 0) ?_)) user) (message-number-base36 (user-uid) -1)) (message-number-base36 (+ (car tm) (ash (% message-unique-id-char 25) 16)) 4) (message-number-base36 (+ (nth 1 tm) (ash (/ message-unique-id-char 25) 16)) 4) ;; Append a given name, because while the generated ID is unique ;; to this newsreader, other newsreaders might otherwise generate ;; the same ID via another algorithm. ".fsf"))) One way to figure out what happens is to use the M-x edebug-defun command on the function, and then calling it. You will then be able to step through the function, seeing every return value along the way. Here is the manual: · https://www.gnu.org/software/emacs/manual/html_node/eintr/edebug.html It is quite handy! E.g. the "87" you see is due to your uid, from the line: (message-number-base36 (user-uid) -1)) Best regards, Adam -- "I wish *I* was a tiger!" Adam Sjøgren "A common lament." asjo@koldfront.dk
Andreas Schwab <schwab@linux-m68k.org> writes: > On Nov 16 2019, 황병희 wrote: > >> According my view: >> gnu/linux start with "87" >> darwin start with "m2" >> windows-nt start with "86" or "83" > > The first number is always (user-uid). "87" is 1000, "m2" is 501, "86" > is 1001, "83" is 1004. Wow! It was real secret!!! FANTASTIC!!! Thank You Andreas^^^ > Andreas. Sincerely, -- ^고맙습니다 _地平天成_ 감사합니다_^))//
> (message-number-base36 (user-uid) -1))
Sorry still i do not understand what that means.
We can set other user-uid by setq?
Sincerely,
--
^고맙습니다 _地平天成_ 감사합니다_^))//
황병희 writes: >> (message-number-base36 (user-uid) -1)) > > Sorry still i do not understand what that means. Let's unpack inside-out: ,----[ C-h f user-uid RET ] | user-uid is a built-in function in ‘C source code’. | | (user-uid) | | Probably introduced at or before Emacs version 18. | This function does not change global state, including the match data. | | Return the effective uid of Emacs. | Value is a fixnum, if it’s small enough, otherwise a bignum. `---- So we get the uid of the user running Emacs. If you're on a one-user Linux-system, that's often 1000. For example, on my Debian GNU/Linux machine: $ grep $USER /etc/passwd asjo:x:1000:1000:Adam Sjøgren,,,:/home/asjo:/bin/bash my uid is 1000. Now, the next function: ,----[ C-h f message-number-base36 RET ] | message-number-base36 is a compiled Lisp function in ‘message.el’. | | (message-number-base36 NUM LEN) | | Not documented. `---- Not documented, but we can guess what it does from the name - it takes a number and a length as input, and converts it to base36. Here is the entire function from message.el: (defun message-number-base36 (num len) (if (if (< len 0) (<= num 0) (= len 0)) "" (concat (message-number-base36 (/ num 36) (1- len)) (char-to-string (aref "zyxwvutsrqponmlkjihgfedcba9876543210" (% num 36)))))) As 1000 is 27*36 + 28*1, you can see it gets translated into "87" by this function. So there is no secret here. > We can set other user-uid by setq? No, but if you run Emacs as another user, with another uid, you get another beginning of your Message-ID. Best regards, Adam -- "I wish *I* was a tiger!" Adam Sjøgren "A common lament." asjo@koldfront.dk
> As 1000 is 27*36 + 28*1, you can see it gets translated into "87" by
> this function.
>
> So there is no secret here.
Wow your comment is very clean. Now i did understand, thanks Adam^^^
Sincerely,
--
^고맙습니다 _地平天成_ 감사합니다_^))//
> No, but if you run Emacs as another user, with another uid, you get
> another beginning of your Message-ID.
So i did make other account (byunghee:51547) in Ubuntu 18.04.
Really thanks Adam, indeed...;;;
Sincerely,
--
^고맙습니다 _地平天成_ 감사합니다_^))//
byunghee.hwang@daum.net (황병희) writes: >> No, but if you run Emacs as another user, with another uid, you get >> another beginning of your Message-ID. > > So i did make other account (byunghee:51547) in Ubuntu 18.04. > Really thanks Adam, indeed...;;; Also i did make some relative simple code [0] with Python. That works only for me. Really i am so happy^^^ [0] https://gitlab.com/soyeomul/Gnus/blob/a233ed2e982f997766d342456f95755f9be9b76c/thanks-mid.py Sincerely, -- ^고맙습니다 _地平天成_ 감사합니다_^))//
> Also i did make some relative simple code [0] with Python. That works only > for me. Really i am so happy^^^ > > [0] > https://gitlab.com/soyeomul/Gnus/blob/a233ed2e982f997766d342456f95755f9be9b76c/thanks-mid.py There were many typo. So i did update the code [1] with quiet ;;; [1] https://gitlab.com/soyeomul/Gnus/blob/4d231b7fc34a2fc8c649f7b6dbd0753c9816504d/thanks-mid.py Sicnerely, -- ^고맙습니다 _地平天成_ 감사합니다_^))//
soyeomul@doraji.xyz (황병희) writes: >> Also i did make some relative simple code [0] with Python. That works only >> for me. Really i am so happy^^^ >> >> [0] >> https://gitlab.com/soyeomul/Gnus/blob/a233ed2e982f997766d342456f95755f9be9b76c/thanks-mid.py > > There were many typo. So i did update the code [1] with quiet ;;; > > [1] > https://gitlab.com/soyeomul/Gnus/blob/4d231b7fc34a2fc8c649f7b6dbd0753c9816504d/thanks-mid.py It's real final code [2]. [2] https://gitlab.com/soyeomul/Gnus/blob/1eb8e8c6f944a4402bac958ba9875bb2815abdfb/thanks-mid.py Sincerely, Gnus' fan Byung-Hee from South Korea -- ^고맙습니다 _地平天成_ 감사합니다_^))//
soyeomul@doraji.xyz (황병희) writes: [... long line snip ...] Hi again, i don't think this is real final code. My mind sometimes runs as Typhoon: https://gitlab.com/soyeomul/Gnus/-/blob/master/mid/tmid.py Sincerely, Gnus fan Byung-Hee -- ^고맙습니다 _和合團結_ 감사합니다_^))//
soyeomul@doraji.xyz (황병희) writes: > soyeomul@doraji.xyz (황병희) writes: > > [... long line snip ...] > > Hi again, i don't think this is real final code. My mind sometimes runs > as Typhoon: ... As Gnus fan, i did write this python code [***] for 1 year with all respect!!! Eventually, i did portray Message-ID as <<the Universe>>. There are require files such as __yw__.json, __yw__.py, lex__.py and the last file *tmid.py* is exec file. Also __yw__.json file's permisson is r--r--r-- and the path is '/__yw__/__yw__.json'. I still don't know python's class() things so all codes run with def() things. [***] Gnus fan's hobby code: https://gitlab.com/soyeomul/Gnus/-/tree/0722de387630097da854a1a402aea4382520a80c/mid Sincerely, Gnus fan Byung-Hee from South Korea -- ^고맙습니다 _白衣從軍_ 감사합니다_^))//
soyeomul@doraji.xyz (황병희) writes: > soyeomul@doraji.xyz (황병희) writes: > >> soyeomul@doraji.xyz (황병희) writes: >> >> [... long line snip ...] >> >> Hi again, i don't think this is real final code. My mind sometimes runs >> as Typhoon: ... > > As Gnus fan, i did write this python code [***] for 1 year with all > respect!!! Eventually, i did portray Message-ID as <<the Universe>>. And then, i did clean up the codes [^^^] by moving to one repository [__yw__] so now i am very happy!!! Also my Gnus is *now* Super Sports Car, what a wonderful world^^^ [^^^]: https://gitlab.com/soyeomul/__yw__ Sincerely, Gnus fan Byung-Hee -- ^고맙습니다 _白衣從軍_ 감사합니다_^))//
Adam Sjøgren <asjo@koldfront.dk> writes:
> ,----[ C-h f user-uid RET ]
> | user-uid is a built-in function in ‘C source code’.
> |
> | (user-uid)
> |
> | Probably introduced at or before Emacs version 18.
> | This function does not change global state, including the match data.
> |
> | Return the effective uid of Emacs.
> | Value is a fixnum, if it’s small enough, otherwise a bignum.
> `----
Offtopic, how to generate function documentation in this style in Gnus?
It looks so fancy.
--
Zhiwei Chen
> [^^^]: https://gitlab.com/soyeomul/__yw__
Last night, i did add BTS/ARMY into my Python codes. In Particular,
BTS/ARMY will runs *always* with _uuid(). And _really_ my spam mail will
be the last at here, thanks^^^
What a beautiful World!!!
Sincerely, Gnus fan Byung-Hee
--
^고맙습니다 _和合團結_ 감사합니다_^))//