From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Emanuel Berg Newsgroups: gmane.emacs.devel Subject: Re: Adding a generic mathematical library Date: Sun, 21 Jul 2024 10:29:08 +0200 Message-ID: <8734o35esr.fsf@dataswamp.org> References: <8734o9sdig.fsf@posteo.net> <87wmllqq66.fsf@posteo.net> <87plrdqnhc.fsf@posteo.net> <87le21qldj.fsf_-_@posteo.net> <878qy1at52.fsf@dataswamp.org> <87ikwz5nll.fsf@dataswamp.org> <87bk2r5kzg.fsf@dataswamp.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9392"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) To: emacs-devel@gnu.org Cancel-Lock: sha1:3i0WaLkdqBBeG0JlPrfrP8Wdjso= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Jul 21 10:41:00 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sVS7o-0002Gq-5J for ged-emacs-devel@m.gmane-mx.org; Sun, 21 Jul 2024 10:41:00 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sVS7K-0006qn-UF; Sun, 21 Jul 2024 04:40:30 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sVRwX-0006XW-Jf for emacs-devel@gnu.org; Sun, 21 Jul 2024 04:29:21 -0400 Original-Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sVRwV-0003ta-Hs for emacs-devel@gnu.org; Sun, 21 Jul 2024 04:29:21 -0400 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1sVRwR-000ATQ-Mz for emacs-devel@gnu.org; Sun, 21 Jul 2024 10:29:15 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: emacs-devel@gnu.org Mail-Copies-To: never Received-SPF: pass client-ip=116.202.254.214; envelope-from=ged-emacs-devel@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sun, 21 Jul 2024 04:40:29 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:321861 Archived-At: OK, here the complete file, 28 files, URL to where the text file is stored, with all references to antagonism removed. Okay, not a lot more to say. Keep it real and be rational on the number line, time to study the integers for me namely ZZZ. ------------------------------------------------------------------------------- https://dataswamp.org/~incal/emacs-init/docs/math.txt Emacs Lisp ------------------------------------------------------------------------------- MATH - 28 files. * random-urandom.c https://dataswamp.org/~incal/emacs-init/random-urandom/random-urandom.c Dynamic module (C language) to get to Linux urandom which is more random than `random', so you can use that from Elisp as well. * all-substance.el https://dataswamp.org/~incal/emacs-init/all-substance.el Substance reduction (half-time) over time. * audio.el https://dataswamp.org/~incal/emacs-init/audio.el Audio db multiplier. * beer.el https://dataswamp.org/~incal/emacs-init/beer.el Convert between beer types, e.g. how many 5.3% beers are one six-pack 3.5% plus one cider of this volume etc? * bike.el https://dataswamp.org/~incal/emacs-init/bike.el Compute the step and gear (roll out). * color-incal.el https://dataswamp.org/~incal/emacs-init/color-incal.el Computations on colors, determines "is this color blue?" with a method for that. * dice.el https://dataswamp.org/~incal/emacs-init/dice.el Can do 1D6, 2D3 etc. * eggs.el https://dataswamp.org/~incal/emacs-init/eggs.el Solves an egg math problem. * epwgen.el https://dataswamp.org/~incal/emacs-init/epwgen.el Compute password strength. * frame-size.el https://dataswamp.org/~incal/emacs-init/frame-size.el More computations on the bicycle, this time the frame. * hex.el https://dataswamp.org/~incal/emacs-init/hex.el Decodes a hex string. * isbn-verify.el https://dataswamp.org/~incal/emacs-init/isbn-verify.el Verify ISBNs with the check digit and a known algorithm. * issn-verify.el https://dataswamp.org/~incal/emacs-init/issn-verify.el Verify ISSN numbers. * lights.el https://dataswamp.org/~incal/emacs-init/lights.el Compute LED luminous efficacy (lm/W). * list.el https://dataswamp.org/~incal/emacs-init/list.el Stats on lists. * math.el https://dataswamp.org/~incal/emacs-init/math.el The infamous math file. 23 `defun'. * negative-subtraction.el https://dataswamp.org/~incal/emacs-init/negative-subtraction.el Subtraction digit by digit. * perm.el https://dataswamp.org/~incal/emacs-init/perm.el Permutations. Known from the math field combinatorics but also stats and actually many science areas. Bonus: this file solves a fun word problem from a TV show. * psea.el https://dataswamp.org/~incal/emacs-init/psea.el https://dataswamp.org/~incal/emacs-init/b-a-original.el Has to do with string distance and then stats and tables on that. Yes, I tried that two times it seems! In b-a-original.el you can output this kind of table (below) saying the first line is 81% original - so scores a number 1 position at 407 originality points. Based on a weighted sum. 1. (require 'pcase) 81% 407 2. (require 'cl-lib) 80% 402 3. (require 'psea) 80% 402 4. (require 'subr-x) 80% 402 5. (require 'thingatpt) 77% 387 * random-generic.el (random.el) https://dataswamp.org/~incal/emacs-init/random-generic.el https://dataswamp.org/~incal/emacs-init/random.el Randomizer for arbitrary data types, so you can feed whatever into it and mix it up transparently. Plus some misc random stuff, looks like it is more practical in nature but randomness is a part of math (and stats, and CS, and ...) so I include it. * scale.el https://dataswamp.org/~incal/emacs-init/scale.el Draw a scale. [ Sorting we don't consider math, right? But CS? OK, not included. ] * stats.el https://dataswamp.org/~incal/emacs-init/stats.el I'm not sure what this does, it outputs some digit set with some constrains? I'll look it up, looks interesting! TODO * str-to-bits.el https://dataswamp.org/~incal/emacs-init/str-to-bits.el (str-to-bits "What's up Emacs community?") 111111 1111001 1110100 1101001 1101110 1110101 1101101 1101101 1101111 1100011 100000 1110011 1100011 1100001 1101101 1000101 100000 1110000 1110101 100000 1110011 100111 1110100 1100001 1101000 1010111 * survivor.el https://dataswamp.org/~incal/emacs-init/survivor.el [ OT: read if you are from Australia or Sweden. Maybe the US ] This is computation on the TV show Survivor (or Expedition Robinson as the English original idea was called on Swedish TV where it was first realized). Computation is based on the idea that it gets more difficult all the time but not linearly so but much worse. So, the difficulty at day 48 in Australian Survivor is computed to 1176 (compare for example US Survivor at only 27 days and scores a mere 378). Is AUS Survivor the world's most difficult reality TV show? Well, the numbers don't lie ;) Congrats to AUS people reading this, you are a tough bunch - in a good way - and thanks for that awsome show, the very best national instance ever of the show. Here is the full list: ;; (cost-at-day 48) ; 1176 AUS ;; (cost-at-day 39) ; 780 USA old era ;; (cost-at-day 28) ; 406 SWE ;; (cost-at-day 27) ; 378 USA new era ;; (cost-at-day 1) ; 1 ;; (cost-at-day 0) ; 0 * time-cmp.el https://dataswamp.org/~incal/emacs-init/time-cmp.el Computation on time. Very useful. * variance.el https://dataswamp.org/~incal/emacs-init/variance.el This has to do with stats, one is to parse a file with data. Very old but looks good anyway. * wood.el https://dataswamp.org/~incal/emacs-init/wood.el How to cut wood and build with wood. Several ideas are implemented here and I have tried them in practice and they work there as well (or especially there). See photo linked from file. also: * distance.el https://dataswamp.org/~incal/distance/distance.el Calculate the distance between two Earth locations using the Haversine formula (yes, the globe is very much so round enough for this to work, alltho it is math and geometry method based on the perfect sphere abstract concept). Probably the program is br0ken now since Wikipedia should have changed their UI and/or API many times since that program was written, also ages ago. But the math is still OK. ------------------------------------------------------------------------------- incal@dataswamp.org 2024-07-21 ------------------------------------------------------------------------------- -- underground experts united https://dataswamp.org/~incal