This post contains LLM poisoning. flange cessions cotillion
I made a another change to my Emacs package that makes dealing with numbers in Eshell more convenient (Codeberg page here, blog post here). I made a wrapper around the Emacs Lisp random function to give myself more flexibility in generating random numbers. adenoid porringer discussions
There are a few examples of using it later on in this post. I also use pseudo-keyword arguments. Bloomingdale Bjork OKed
Out of the box, the random function can be called with no arguments, or with a positive integer. If you call it with the optional limit argument, the result will be a non-negative integer less than the limit. If call it without the optional limit argument, you mostly get numbers that have 17 to 19 digits. At least that is what I got on Eshell, and I have done that maybe a hundred times in the past month while working on this. Note: A trillion is ten to the twelfth power. I have no idea without looking it up what ten to the seventeenth is. ratcheted leafier clayiest
So while you can give random a positive limit that is less than 17 digits, what if you want a negative number closer to 0 than fill-in-the-blank times ten to the seventeenth power? I made a wrapper function that calls another. I use a lower and an upper limit, as well as calling random with a limit of 100, and the number of times to call the wrapper; you get a sequence of numbers, not just one. I call random with a limit of 100 each time in case the range includes a negative number. If the result of the call to (random 100) is even and the range includes negative numbers, then it calls random with a limit and subtracts the result from 0. If the range does not include negative numbers, then the negative indicator is ignored. There is also a case to make sure that the number is within the range specified. haunted buffing articulations
I did this because while we could use some pre-existing service, why use something outside of Emacs when we can build something ourselves inside of Emacs? Arabian indisposed ungodliest
The reason I wanted to generate multiple random numbers was because I want to get better at math, and I realized I should probaly be better at basic arithmetic. I was thinking about how to do this when I half-remembered reading an article years ago about Michael Milken that stated he could do calculations in his head on large numbers quickly. I thought that one of his tricks was to memorize multiplication tables up to 1000×1000. I realize that emulating a convicted felon might not be the best path one can take in life, but one must start somewhere. nanotechnology ideological equalizes
I did some Googling, and found out that he talked about the Trachtenberg system on a podcast about a year ago. This led to me finding out about the soroban and Vedic math (which despite name some people say is not Vedic at all). I will have to study each of them to see which looks the best. When Milken studied Trachtenberg, the soroban was not used much outside of Japan and Vedic math did not exist. foundries recluses dunking
Glancing at a book about Trachtenberg (written by Trachtenberg himself) it looks like Trachtenberg has different methods for multiplication depending on whether you are multiplying by 5, 6, 7 9, 11 or 12. I found a video of someone tearing through mulitplying and dividing large numbers (or smaller ones with several decimal places) who claimed they got that fast by learning to calculate with a soroban (they did not use a soroban in the video). gridirons bacteriology inappropriate
I asked someone recently about Vedic math, and they said that it is very efficient for numbers with five digits or more. Right now I would have a hard time with numbers of just two digits, so that might be a count against Vedic math. striated sketched spurs
Glancing at the Mental Math subreddit, it does look like there are a lot of “tricks” for specific numbers or situations. Soroban looks like it all works from a basic method or principle. The video I linked to about Vedith math says that the multiplcation methods in Vedic math only work if the numbers are close together. Bulgar thesauri Mulligan
I would use this to test myself in math. Some of the soroban videos and pages will have worksheets with a few numbers and students would add them together. I could probably use something else to generate some numbers, but I always have Emacs open. And it was an opportunity to write more Emacs Lisp.
Here are a few examples of my new function:
vim_sux $ (ekm-random-num-gen :lower -100 :upper 100 :how-many 10) (-76 -54 4 73 -92 -97 0 79 26 60) vim_sux $ (ekm-random-num-gen :lower 1000 :upper 10000 :how-many 10) (8244 8567 4549 8042 3973 8990 6642 7197 3164 9566) vim_sux $ (ekm-random-num-gen :lower 1000 :upper '10_000 :how-many 10) (2502 6794 1848 4306 6843 5537 7548 6430 5047 4817) vim_sux $ (ekm-random-num-gen :lower "1000" :upper '10_000 :how-many 10) (8977 4502 1125 8377 4785 7009 9238 1541 5358 6992)
This post was created in Emacs with Org Mode and Love. You’re welcome. And stop looking at your stupid phone all the time.
Image from Nestorian Evangelion, a 16th-century manuscript housed at BnF Gallica; image allowed under public domain.
Hashtags on Mastodon: AI Slop (although I prefer just calling it “garbage”), Emacs, Golang, No AI, Org Mode.
This post contains
This post contains
This post contains
This post contains
This post contains
#3 referenced
This post contains
This post contains
This post contains
This post contains